X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fuuid.c;h=18748ea954c7e611c06863b336d0b8983ec86868;hb=97be153858b4cd175cbe7862b8e1624bf22ab98a;hp=7b03fe0b6d81c28c6f5d48a81befe30d816d348c;hpb=2b51596fdeba7fbf4caff323dd6af375e7f84596;p=sliver-openvswitch.git diff --git a/lib/uuid.c b/lib/uuid.c index 7b03fe0b6..18748ea95 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -81,19 +81,19 @@ uuid_init(void) void uuid_generate(struct uuid *uuid) { - static pthread_mutex_t mutex = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER; + static struct ovs_mutex mutex = OVS_ADAPTIVE_MUTEX_INITIALIZER; uint64_t copy[2]; uuid_init(); /* Copy out the counter's current value, then increment it. */ - xpthread_mutex_lock(&mutex); + ovs_mutex_lock(&mutex); copy[0] = counter[0]; copy[1] = counter[1]; if (++counter[1] == 0) { counter[0]++; } - xpthread_mutex_unlock(&mutex); + ovs_mutex_unlock(&mutex); /* AES output is exactly 16 bytes, so we encrypt directly into 'uuid'. */ aes128_encrypt(&key, copy, uuid);