* *****************************************************************************/
| 855 | * |
| 856 | *****************************************************************************/ |
| 857 | int |
| 858 | Thread_UpdateState(Thread *th, ThreadState newval, ThreadState oldval) |
| 859 | { |
| 860 | int res = 0; |
| 861 | |
| 862 | JASSERT(DmtcpMutexLock(&threadStateLock) == 0); |
| 863 | if (oldval == th->state) { |
| 864 | th->state = newval; |
| 865 | res = 1; |
| 866 | } |
| 867 | JASSERT(DmtcpMutexUnlock(&threadStateLock) == 0); |
| 868 | return res; |
| 869 | } |
| 870 | |
| 871 | /***************************************************************************** |
| 872 | * |
no test coverage detected