thr_suspend_np.c (17706) | thr_suspend_np.c (22315) |
---|---|
1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 39 unchanged lines hidden (view full) --- 48 if (pthread == thread) { 49 /* Found the thread. Is it running? */ 50 if (pthread->state != PS_RUNNING && 51 pthread->state != PS_SUSPENDED) { 52 /* The thread operation has been interrupted */ 53 _thread_seterrno(pthread,EINTR); 54 } 55 /* Suspend the thread. */ | 1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 39 unchanged lines hidden (view full) --- 48 if (pthread == thread) { 49 /* Found the thread. Is it running? */ 50 if (pthread->state != PS_RUNNING && 51 pthread->state != PS_SUSPENDED) { 52 /* The thread operation has been interrupted */ 53 _thread_seterrno(pthread,EINTR); 54 } 55 /* Suspend the thread. */ |
56 pthread->state = PS_SUSPENDED; | 56 PTHREAD_NEW_STATE(pthread,PS_SUSPENDED); |
57 ret = 0; 58 } 59 } 60 /* Check if thread was not found. */ 61 if (ret == -1) { 62 /* No such thread */ | 57 ret = 0; 58 } 59 } 60 /* Check if thread was not found. */ 61 if (ret == -1) { 62 /* No such thread */ |
63 _thread_seterrno(_thread_run,ESRCH); | 63 errno = ESRCH; |
64 } 65 return(ret); 66} 67#endif | 64 } 65 return(ret); 66} 67#endif |