Lines Matching refs:pid

118 sanei_thread_set_invalid( SANE_Pid *pid )
123 *pid = (pthread_t) 0;
125 pid->p = 0;
128 *pid = (pthread_t) -1;
135 sanei_thread_is_valid( SANE_Pid pid )
141 if (pid == 0)
143 if (pid.p == 0)
147 if (pid == (SANE_Pid) -1)
159 sanei_thread_pid_to_long( SANE_Pid pid )
165 rc = (long) pid;
167 rc = pid.p;
170 rc = (long) pid;
177 sanei_thread_kill( SANE_Pid pid )
180 sanei_thread_pid_to_long(pid));
183 return pthread_kill((pthread_t)pid, SIGUSR2);
185 return pthread_cancel((pthread_t)pid);
188 return DosKillThread(pid);
190 return kill( pid, SIGTERM );
218 SANE_Pid pid;
223 pid = _beginthread( local_thread, NULL, 1024*1024, (void*)&td );
224 if ( pid == -1 ) {
229 DBG( 2, "_beginthread() created thread %d\n", pid );
230 return pid;
234 sanei_thread_waitpid( SANE_Pid pid, int *status )
238 return pid; /* DosWaitThread( (TID*) &pid, DCWW_WAIT);*/
242 sanei_thread_sendsig( SANE_Pid pid, int sig )
271 SANE_Pid pid;
276 pid = spawn_thread( local_thread, "sane thread (yes they can be)", B_NORMAL_PRIORITY, (void*)&td );
277 if ( pid < B_OK ) {
281 if ( resume_thread(pid) < B_OK ) {
286 DBG( 2, "spawn_thread() created thread %d\n", pid );
287 return pid;
291 sanei_thread_waitpid( SANE_Pid pid, int *status )
294 if ( wait_for_thread(pid, &st) < B_OK )
298 return pid;
302 sanei_thread_sendsig( SANE_Pid pid, int sig )
306 return kill(pid, sig);
388 eval_wp_result( SANE_Pid pid, int wpres, int pf )
392 if( wpres == pid ) {
450 SANE_Pid pid;
451 pid = fork();
452 if( pid < 0 ) {
457 if( pid == 0 ) {
467 return pid;
472 sanei_thread_sendsig( SANE_Pid pid, int sig )
475 sanei_thread_pid_to_long(pid));
477 return pthread_kill( (pthread_t)pid, sig );
479 return kill( pid, sig );
484 sanei_thread_waitpid( SANE_Pid pid, int *status )
491 SANE_Pid result = pid;
497 sanei_thread_pid_to_long(pid));
500 rc = pthread_join( (pthread_t)pid, (void*)&ls );
510 result = pid;
513 if ( (pthread_t)pid != pthread_self() ) {
518 sanei_thread_pid_to_long(pid) );
519 pthread_detach((pthread_t)pid);
527 result = waitpid( pid, &ls, 0 );
530 result = pid;
532 stat = eval_wp_result( pid, result, ls );
544 sanei_thread_get_status( SANE_Pid pid )
547 _VAR_NOT_USED( pid );
554 if( pid > 0 ) {
556 result = waitpid( pid, &ls, WNOHANG );
558 stat = eval_wp_result( pid, result, ls );