mtx_init

mtx_init

Defined in header <threads.h>
int mtx_init( mtx_t* mutex, int type );
(since C11)

Creates a new mutex object with type. The object pointed to by mutex is set to an identifier of the newly created mutex.

type must have one of the following values:

Parameters

mutex - pointer to the mutex to initialize
type - the type of the mutex

Return value

thrd_success if successful, thrd_error otherwise.

References

  • C11 standard (ISO/IEC 9899:2011):
    • 7.26.4.2 The mtx_init function (p: 381)

See also

C++ documentation for recursive_timed_mutex

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/c/thread/mtx_init

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部