X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fovs-thread.h;h=b7bc5d198136de048464879d4bdf0204b7cfb344;hb=6b900de4efd368be88ef3db88b1eff8f835a7cf7;hp=e644832b2f9c7f051502f968a89c7809eab917ef;hpb=6878fada586a8ed5f45a50f9c8834dcf06bdc1f5;p=sliver-openvswitch.git diff --git a/lib/ovs-thread.h b/lib/ovs-thread.h index e644832b2..b7bc5d198 100644 --- a/lib/ovs-thread.h +++ b/lib/ovs-thread.h @@ -116,7 +116,7 @@ void ovs_rwlock_unlock(const struct ovs_rwlock *rwlock) OVS_RELEASES(rwlock); void ovs_rwlock_wrlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_ACQ_WRLOCK(rwlock); #define ovs_rwlock_wrlock(rwlock) \ - ovs_rwlock_wrlock_at(rwlock, SOURCE_LOCATOR); + ovs_rwlock_wrlock_at(rwlock, SOURCE_LOCATOR) int ovs_rwlock_trywrlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_TRY_WRLOCK(0, rwlock); @@ -126,7 +126,7 @@ int ovs_rwlock_trywrlock_at(const struct ovs_rwlock *rwlock, const char *where) void ovs_rwlock_rdlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_ACQ_RDLOCK(rwlock); #define ovs_rwlock_rdlock(rwlock) \ - ovs_rwlock_rdlock_at(rwlock, SOURCE_LOCATOR); + ovs_rwlock_rdlock_at(rwlock, SOURCE_LOCATOR) int ovs_rwlock_tryrdlock_at(const struct ovs_rwlock *rwlock, const char *where) OVS_TRY_RDLOCK(0, rwlock); @@ -156,6 +156,7 @@ void xpthread_key_create(pthread_key_t *, void (*destructor)(void *)); void xpthread_setspecific(pthread_key_t, const void *); void xpthread_create(pthread_t *, pthread_attr_t *, void *(*)(void *), void *); +void xpthread_join(pthread_t, void **); /* Per-thread data. * @@ -466,12 +467,12 @@ struct ovsthread_once { } static inline bool ovsthread_once_start(struct ovsthread_once *once) - OVS_TRY_LOCK(true, &once->mutex); + OVS_TRY_LOCK(true, once->mutex); void ovsthread_once_done(struct ovsthread_once *once) - OVS_RELEASES(&once->mutex); + OVS_RELEASES(once->mutex); bool ovsthread_once_start__(struct ovsthread_once *once) - OVS_TRY_LOCK(false, &once->mutex); + OVS_TRY_LOCK(false, once->mutex); static inline bool ovsthread_once_is_done__(const struct ovsthread_once *once) @@ -495,11 +496,6 @@ ovsthread_once_start(struct ovsthread_once *once) return OVS_UNLIKELY(!ovsthread_once_is_done__(once) && !ovsthread_once_start__(once)); } - -#ifdef __CHECKER__ -#define ovsthread_once_start(ONCE) \ - ((ONCE)->done ? false : ({ OVS_MACRO_LOCK((&ONCE->mutex)); true; })) -#endif /* Thread ID. *