thr_resume_np.c (17706) | thr_resume_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 --- 35 unchanged lines hidden (view full) --- 44 * Search for the thread in the linked list. 45 */ 46 for (pthread = _thread_link_list; pthread != NULL && ret == -1; pthread = pthread->nxt) { 47 /* Is this the thread? */ 48 if (pthread == thread) { 49 /* Found the thread. Is it suspended? */ 50 if (pthread->state == PS_SUSPENDED) { 51 /* Allow the thread to run. */ | 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 --- 35 unchanged lines hidden (view full) --- 44 * Search for the thread in the linked list. 45 */ 46 for (pthread = _thread_link_list; pthread != NULL && ret == -1; pthread = pthread->nxt) { 47 /* Is this the thread? */ 48 if (pthread == thread) { 49 /* Found the thread. Is it suspended? */ 50 if (pthread->state == PS_SUSPENDED) { 51 /* Allow the thread to run. */ |
52 pthread->state = PS_RUNNING; | 52 PTHREAD_NEW_STATE(pthread,PS_RUNNING); |
53 ret = 0; 54 } else if (pthread->state == PS_RUNNING) { 55 /* Thread is already running. */ 56 ret = 0; 57 } else { 58 /* Thread is in some other state. */ | 53 ret = 0; 54 } else if (pthread->state == PS_RUNNING) { 55 /* Thread is already running. */ 56 ret = 0; 57 } else { 58 /* Thread is in some other state. */ |
59 _thread_seterrno(_thread_run,EINVAL); | 59 errno = EINVAL; |
60 } 61 } 62 } 63 /* Check if thread was not found. */ 64 if (ret == -1) { 65 /* No such thread */ | 60 } 61 } 62 } 63 /* Check if thread was not found. */ 64 if (ret == -1) { 65 /* No such thread */ |
66 _thread_seterrno(_thread_run,ESRCH); | 66 errno = ESRCH; |
67 } 68 return(ret); 69} 70#endif | 67 } 68 return(ret); 69} 70#endif |