aboutsummaryrefslogtreecommitdiffstats
path: root/src/mutex.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2012-04-30 12:38:29 +0200
committerJason Evans <je@fb.com>2012-04-30 17:57:31 -0700
commitda99e31105eb709ef4ec8a120b115c32a6b9723a (patch)
tree64e40c341b6360ab618d4403a9050d1f3310503f /src/mutex.c
parent7cdea3973cab8640d1f44c7638ed5e30ed18be24 (diff)
downloadplatform_external_jemalloc_new-da99e31105eb709ef4ec8a120b115c32a6b9723a.tar.gz
platform_external_jemalloc_new-da99e31105eb709ef4ec8a120b115c32a6b9723a.tar.bz2
platform_external_jemalloc_new-da99e31105eb709ef4ec8a120b115c32a6b9723a.zip
Replace JEMALLOC_ATTR with various different macros when it makes sense
Theses newly added macros will be used to implement the equivalent under MSVC. Also, move the definitions to headers, where they make more sense, and for some, are even more useful there (e.g. malloc).
Diffstat (limited to 'src/mutex.c')
-rw-r--r--src/mutex.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mutex.c b/src/mutex.c
index 159d82a3..37a843e6 100644
--- a/src/mutex.c
+++ b/src/mutex.c
@@ -48,8 +48,7 @@ pthread_create_once(void)
isthreaded = true;
}
-JEMALLOC_ATTR(visibility("default"))
-int
+JEMALLOC_EXPORT int
pthread_create(pthread_t *__restrict thread,
const pthread_attr_t *__restrict attr, void *(*start_routine)(void *),
void *__restrict arg)
@@ -72,6 +71,7 @@ int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
bool
malloc_mutex_init(malloc_mutex_t *mutex)
{
+
#ifdef _WIN32
if (!InitializeCriticalSectionAndSpinCount(&mutex->lock,
_CRT_SPINCOUNT))
@@ -98,7 +98,6 @@ malloc_mutex_init(malloc_mutex_t *mutex)
return (true);
}
pthread_mutexattr_destroy(&attr);
-
#endif
return (false);
}