| 32 | } |
| 33 | |
| 34 | int thread_setup(void) { |
| 35 | mutex_buf = new pthread_mutex_t[CRYPTO_num_locks()]; |
| 36 | if (mutex_buf == NULL) { |
| 37 | return 0; |
| 38 | } |
| 39 | for (int i = 0; i < CRYPTO_num_locks(); i++) { |
| 40 | MUTEX_SETUP(mutex_buf[i]); |
| 41 | } |
| 42 | CRYPTO_set_id_callback(gpcloud_id_function); |
| 43 | CRYPTO_set_locking_callback(gpcloud_locking_function); |
| 44 | return 1; |
| 45 | } |
| 46 | |
| 47 | int thread_cleanup(void) { |
| 48 | if (mutex_buf == NULL) { |