-int pd_uuid_make_v1mc(struct pd_uuid_state *ps, pd_uuid_t *uuid) {
- struct pd_uuid_state s;
- uint64_t now;
- uint64_t node;
-
- obtain_global_lock(0);
- read_state(&s);
- now = current_time();
- node = random_mc_mac(&s);
- if (!s.available) {
- s.clock_sequence = random_clock_sequence(&s);
- }
-
- if (s.available && s.timestamp > now) {
- s.clock_sequence++;
- } else {
- s.timestamp = now;
- }
-
- save_state(&s);
- release_global_lock(0);
- s.node = node;
-
- format_uuid(uuid, &s, 1);
-
- return 1;
-}
-