1eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea/*
2eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * Copyright (C) 2012 The Android Open Source Project
3eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea *
4eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * Licensed under the Apache License, Version 2.0 (the "License");
5eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * you may not use this file except in compliance with the License.
6eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * You may obtain a copy of the License at
7eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea *
8eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea *      http://www.apache.org/licenses/LICENSE-2.0
9eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea *
10eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * Unless required by applicable law or agreed to in writing, software
11eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * distributed under the License is distributed on an "AS IS" BASIS,
12eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * See the License for the specific language governing permissions and
14eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea * limitations under the License.
15eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea */
16eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea
17eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea#ifndef _BIONIC_NETBSD_REENTRANT_H_included
18eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea#define _BIONIC_NETBSD_REENTRANT_H_included
19eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea
206b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define _REENTRANT
216b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes
22eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea#include <pthread.h>
23eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea#include <signal.h>
24eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea
256b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes//
266b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes// Map NetBSD libc internal locking to pthread locking.
276b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes//
286b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes
296b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
306b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define mutex_t pthread_mutex_t
31205c7887add8b8c85434c35158138f16265beb28Elliott Hughes#define mutex_lock(x) pthread_mutex_lock(x)
32205c7887add8b8c85434c35158138f16265beb28Elliott Hughes#define mutex_unlock(x) pthread_mutex_unlock(x)
336b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes
346b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER
356b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define rwlock_t pthread_rwlock_t
366b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define rwlock_rdlock pthread_rwlock_rdlock
376b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define rwlock_unlock pthread_rwlock_unlock
386b3f49a5374305ce9690c3c5ca2aadc90f54c521Elliott Hughes#define rwlock_wrlock pthread_rwlock_wrlock
39eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea
40eac9eb462ed6f7fcfb791e7a08b4011fcca47829Irina Tirdea#endif
41