X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fsparse%2Fpthread.h;h=e5b2a08d07e6b6ef8ddc45359f6d6bc404356d46;hb=1e827902be9194d71ea851c9ce2676f65eeed33a;hp=7ba6a05aba2674eb73e888d8960bf9624e59e4a6;hpb=85606e05b691be7c2f2d4bcf0e91170b71ec8fbb;p=sliver-openvswitch.git diff --git a/include/sparse/pthread.h b/include/sparse/pthread.h index 7ba6a05ab..e5b2a08d0 100644 --- a/include/sparse/pthread.h +++ b/include/sparse/pthread.h @@ -21,40 +21,14 @@ /* Get actual definitions for us to annotate and build on. */ #include_next -#include "compiler.h" +/* Sparse complains about the proper PTHREAD_*_INITIALIZER definitions. + * Luckily, it's not a real compiler so we can overwrite it with something + * simple. */ +#undef PTHREAD_MUTEX_INITIALIZER +#define PTHREAD_MUTEX_INITIALIZER {} -int pthread_mutex_lock(pthread_mutex_t *mutex) OVS_ACQUIRES(mutex); -int pthread_mutex_unlock(pthread_mutex_t *mutex) OVS_RELEASES(mutex); +#undef PTHREAD_RWLOCK_INITIALIZER +#define PTHREAD_RWLOCK_INITIALIZER {} -int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) OVS_ACQUIRES(rwlock); -int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) OVS_ACQUIRES(rwlock); -int pthread_rwlock_unlock(pthread_rwlock_t *rwlock) OVS_RELEASES(rwlock); - -int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *mutex) - OVS_MUST_HOLD(mutex); - -#define pthread_mutex_trylock(MUTEX) \ - ({ \ - int retval = pthread_mutex_trylock(mutex); \ - if (!retval) { \ - OVS_ACQUIRE(MUTEX); \ - } \ - retval; \ - }) - -#define pthread_rwlock_tryrdlock(RWLOCK) \ - ({ \ - int retval = pthread_rwlock_tryrdlock(rwlock); \ - if (!retval) { \ - OVS_ACQUIRE(RWLOCK); \ - } \ - retval; \ - }) -#define pthread_rwlock_trywrlock(RWLOCK) \ - ({ \ - int retval = pthread_rwlock_trywrlock(rwlock); \ - if (!retval) { \ - OVS_ACQUIRE(RWLOCK); \ - } \ - retval; \ - }) +#undef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP +#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP {}