| 120 | } |
| 121 | |
| 122 | bool |
| 123 | ThreadSync::libdlLockLock() |
| 124 | { |
| 125 | int saved_errno = errno; |
| 126 | bool lockAcquired = false; |
| 127 | |
| 128 | // The process is still initializing. We don't need to acquire lock. |
| 129 | if (WorkerState::currentState() == WorkerState::UNKNOWN) { |
| 130 | return false; |
| 131 | } |
| 132 | |
| 133 | if (libdlLockOwner != gettid()) { |
| 134 | JASSERT(DmtcpMutexLock(&libdlLock) == 0); |
| 135 | libdlLockOwner = gettid(); |
| 136 | lockAcquired = true; |
| 137 | } |
| 138 | errno = saved_errno; |
| 139 | return lockAcquired; |
| 140 | } |
| 141 | |
| 142 | void |
| 143 | ThreadSync::libdlLockUnlock() |
nothing calls this directly
no test coverage detected