Home

Traffic Server Software Developers Kit

INKMutexLock

Locks an INKMutex.

Prototype

INKReturnCode INKMutexLock (INKMutex mutexp)

Description

Locks the INKMutex mutexp. If mutexp is already locked, then INKMutexLock blocks until the mutex is unlocked. An INKMutex will be recursively locked if INKMutexLock is called on the same mutex twice from the same thread. Thus, the following example will succeed and not block on the second call to INKMutexLock.

Returns

INK_SUCCESS if the mutex is successfully locked.

INK_ERROR if an error occurs.

Example
INKMutexLock (some_mutex);
INKMutexLock (some_mutex);
INKMutexUnlock (some_mutex);
INKMutexUnlock (some_mutex);