Fix build following D59537433
[hiphop-php.git] / hphp / neo / ulocks.c
blob6c76435fefc230ca83f23e02dce1380c2b7b9ed9
1 /*
2 * Copyright 2001-2004 Brandon Long
3 * All Rights Reserved.
5 * ClearSilver Templating System
7 * This code is made available under the terms of the ClearSilver License.
8 * http://www.clearsilver.net/license.hdf
12 #include "cs_config.h"
14 #include <string.h>
16 #include "neo_misc.h"
17 #include "neo_err.h"
18 #include "ulocks.h"
20 #ifdef HAVE_PTHREADS
22 NEOERR *mLock(pthread_mutex_t *mutex)
24 int err;
26 if((err = pthread_mutex_lock(mutex)))
27 return nerr_raise(NERR_LOCK, "Mutex lock failed: %s", strerror(err));
29 return STATUS_OK;
32 NEOERR *mUnlock(pthread_mutex_t *mutex)
34 int err;
36 if((err = pthread_mutex_unlock(mutex)))
37 return nerr_raise(NERR_LOCK, "Mutex unlock failed: %s", strerror(err));
39 return STATUS_OK;
42 #endif