unsigned ctl_rwlock_write_lock(CTL_RWLOCK_t *rwlock,
                               CTL_TIMEOUT_t t,
                               CTL_TIME_t timeout);

ctl_rwlock_write_lock attempts to acquire an exclusive write lock on the read-write lock rwlock. ctl_rwlock_write_lock will block waiting for all read and write locks on rwlock to be released.

If a timeout is specified and this write lock cannot be acquired before the timeout, ctl_rwlock_write_lock returns zero. If this write lock can be acquired, ctl_rwlock_write_lock returns a non-zero result.