summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/os_posix/os_once.c
blob: 8d9000423307571da415b7d214998daae17c6d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*-
 * Copyright (c) 2014-2016 MongoDB, Inc.
 * Copyright (c) 2008-2014 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

#include "wt_internal.h"

/*
 * __wt_once --
 *	One-time initialization per process.
 */
int
__wt_once(void (*init_routine)(void))
{
	static pthread_once_t once_control = PTHREAD_ONCE_INIT;

	return (pthread_once(&once_control, init_routine));
}