Browse Source

Test

etomic
jl777 7 years ago
parent
commit
6a192e19bc
  1. 4
      crypto777/nanosrc/utils/thread_posix.c

4
crypto777/nanosrc/utils/thread_posix.c

@ -30,7 +30,7 @@ static void *nn_thread_main_routine(void *arg)
{ {
struct nn_thread *self; struct nn_thread *self;
self = (struct nn_thread *)arg; self = (struct nn_thread *)arg;
PNACL_msg("nn_thread_main_routine arg.%p self->routine(%p) at %p\n",arg,self->arg,self->routine); printf("nn_thread_main_routine arg.%p self->routine(%p) at %p\n",arg,self->arg,self->routine);
self->routine(self->arg); // Run the thread routine self->routine(self->arg); // Run the thread routine
return NULL; return NULL;
} }
@ -47,7 +47,7 @@ void nn_thread_init(struct nn_thread *self,nn_thread_routine *routine,void *arg)
{ {
int32_t rc; int32_t rc;
// No signals should be processed by this thread. The library doesn't use signals and thus all the signals should be delivered to application threads, not to worker threads. // No signals should be processed by this thread. The library doesn't use signals and thus all the signals should be delivered to application threads, not to worker threads.
PNACL_msg("nn_thread_init routine.%p arg.%p\n",routine,arg); printf("nn_thread_init routine.%p arg.%p\n",routine,arg);
self->routine = routine; self->routine = routine;
self->arg = arg; self->arg = arg;
rc = pthread_create(&self->handle,NULL,nn_thread_main_routine,(void *)self); rc = pthread_create(&self->handle,NULL,nn_thread_main_routine,(void *)self);

Loading…
Cancel
Save