gnunet-android

GNUnet for Android
Log | Files | Refs | README

thread.h (4299B)


      1 // Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //     https://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 
     15 #ifndef OPENSSL_HEADER_THREAD_H
     16 #define OPENSSL_HEADER_THREAD_H
     17 
     18 #include <sys/types.h>
     19 
     20 #include <openssl/base.h>   // IWYU pragma: export
     21 
     22 #if defined(__cplusplus)
     23 extern "C" {
     24 #endif
     25 
     26 
     27 // Deprecated functions.
     28 //
     29 // Historically, OpenSSL required callers to provide locking callbacks.
     30 // BoringSSL does not use external callbacks for locking, but some old code
     31 // calls these functions and so no-op implementations are provided.
     32 
     33 // These defines do nothing but are provided to make old code easier to
     34 // compile.
     35 #define CRYPTO_LOCK 1
     36 #define CRYPTO_UNLOCK 2
     37 #define CRYPTO_READ 4
     38 #define CRYPTO_WRITE 8
     39 
     40 // CRYPTO_num_locks returns one. (This is non-zero that callers who allocate
     41 // sizeof(lock) times this value don't get zero and then fail because malloc(0)
     42 // returned NULL.)
     43 OPENSSL_EXPORT int CRYPTO_num_locks(void);
     44 
     45 // CRYPTO_set_locking_callback does nothing.
     46 OPENSSL_EXPORT void CRYPTO_set_locking_callback(
     47     void (*func)(int mode, int lock_num, const char *file, int line));
     48 
     49 // CRYPTO_set_add_lock_callback does nothing.
     50 OPENSSL_EXPORT void CRYPTO_set_add_lock_callback(int (*func)(
     51     int *num, int amount, int lock_num, const char *file, int line));
     52 
     53 // CRYPTO_get_locking_callback returns NULL.
     54 OPENSSL_EXPORT void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num,
     55                                                          const char *file,
     56                                                          int line);
     57 
     58 // CRYPTO_get_lock_name returns a fixed, dummy string.
     59 OPENSSL_EXPORT const char *CRYPTO_get_lock_name(int lock_num);
     60 
     61 // CRYPTO_THREADID_set_callback returns one.
     62 OPENSSL_EXPORT int CRYPTO_THREADID_set_callback(
     63     void (*threadid_func)(CRYPTO_THREADID *threadid));
     64 
     65 // CRYPTO_THREADID_set_numeric does nothing.
     66 OPENSSL_EXPORT void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id,
     67                                                 unsigned long val);
     68 
     69 // CRYPTO_THREADID_set_pointer does nothing.
     70 OPENSSL_EXPORT void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr);
     71 
     72 // CRYPTO_THREADID_current does nothing.
     73 OPENSSL_EXPORT void CRYPTO_THREADID_current(CRYPTO_THREADID *id);
     74 
     75 // CRYPTO_set_id_callback does nothing.
     76 OPENSSL_EXPORT void CRYPTO_set_id_callback(unsigned long (*func)(void));
     77 
     78 typedef struct {
     79   int references;
     80   struct CRYPTO_dynlock_value *data;
     81 } CRYPTO_dynlock;
     82 
     83 // CRYPTO_set_dynlock_create_callback does nothing.
     84 OPENSSL_EXPORT void CRYPTO_set_dynlock_create_callback(
     85     struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file,
     86                                                         int line));
     87 
     88 // CRYPTO_set_dynlock_lock_callback does nothing.
     89 OPENSSL_EXPORT void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(
     90     int mode, struct CRYPTO_dynlock_value *l, const char *file, int line));
     91 
     92 // CRYPTO_set_dynlock_destroy_callback does nothing.
     93 OPENSSL_EXPORT void CRYPTO_set_dynlock_destroy_callback(
     94     void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l,
     95                                  const char *file, int line));
     96 
     97 // CRYPTO_get_dynlock_create_callback returns NULL.
     98 OPENSSL_EXPORT struct CRYPTO_dynlock_value *(
     99     *CRYPTO_get_dynlock_create_callback(void))(const char *file, int line);
    100 
    101 // CRYPTO_get_dynlock_lock_callback returns NULL.
    102 OPENSSL_EXPORT void (*CRYPTO_get_dynlock_lock_callback(void))(
    103     int mode, struct CRYPTO_dynlock_value *l, const char *file, int line);
    104 
    105 // CRYPTO_get_dynlock_destroy_callback returns NULL.
    106 OPENSSL_EXPORT void (*CRYPTO_get_dynlock_destroy_callback(void))(
    107     struct CRYPTO_dynlock_value *l, const char *file, int line);
    108 
    109 
    110 #if defined(__cplusplus)
    111 }  // extern C
    112 #endif
    113 
    114 #endif  // OPENSSL_HEADER_THREAD_H