svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
mtx_init(3c)
mtx_init(3C) Standard C Library Functions mtx_init(3C)
NAME
mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, mtx_destroy
- C11 mutex functions
SYNOPSIS
#include <threads.h>
int mtx_init(mtx_t *mtx, int type);
int mtx_lock(mtx_t *mtx);
int mtx_timedlock(mtx_t *restrict mtx,
const struct timespec *restrict ts);
int mtx_trylock(mtx_t *mtx);
int mtx_unlock(mtx_t *mtx);
void mtx_destroy(mtx_t *mtx);
DESCRIPTION
The mtx_init(), mtx_lock(), mtx_timedlock(), mtx_trylock(), mtx_un‐
lock(), and mtx_destroy() functions are part of the threads interfaces
as specified in the C11 standard. They are simple wrappers over the
more general pthreads functions. See INCITS/ISO/IEC 9899:2011.
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) C11 ThreadsPOSIX
Threads _ mtx_init()pthread_mutex_init() _ mtx_lock()pthread_mu‐
tex_lock() _ mtx_timedlock()pthread_mutex_timedlock() _ mtx_try‐
lock()pthread_mutex_trylockl() _ mtx_unlock()pthread_mutex_unlock() _
mtx_destroy()pthread_mutex_destroy()
RETURN VALUES
Upon successful completion, each of the mtx_init(), mtx_lock(),
mtx_timedlock(), mtx_trylock(), and mtx_unlock() functions return
thrd_success. If the requested resource is not acquired in the time
specified by ts, the mtx_timedlock() function returns thrd_timedout. If
the resource requested by mtx_trylock() is already in use, mtx_try‐
lock() returns thrd_busy. If the request could not otherwise be honored
by any of these functions, thrd_error is returned.
No value is returned by the mtx_destroy() function.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe
SEE ALSO
pthread_mutex_destroy(3C), pthread_mutex_init(3C), pthread_mu‐
tex_lock(3C), pthread_mutex_timedlock(3C), pthread_mutex_trylock(3C),
pthread_mutex_unlock(3C), threads.h(3HEAD), attributes(7)
Oracle Solaris 11.4 15 Apr 2019 mtx_init(3C)