Deleted Added
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 19 unchanged lines hidden (view full) ---

28 * Atomic allocation of a key number.
29 * -1 means an uninitialized key,
30 * -2 is the initializing lock to assure the single value for the key.
31 */
32 if (nxt_atomic_cmp_set(&tsd->key, -1, -2)) {
33
34 err = pthread_key_create(&key, nxt_thread_key_dtor);
35 if (err != 0) {
36 nxt_main_log_alert("pthread_key_create() failed %E", err);
37 goto fail;
38 }
39
40 tsd->key = (nxt_atomic_t) key;
41
42 nxt_main_log_debug("pthread_key_create(): %A", tsd->key);
43 }
44 }

--- 195 unchanged lines hidden ---