Annotation of embedaddon/strongswan/src/libstrongswan/threading/windows/thread.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * Copyright (C) 2013 Martin Willi
                      3:  * Copyright (C) 2013 revosec AG
                      4:  *
                      5:  * This program is free software; you can redistribute it and/or modify it
                      6:  * under the terms of the GNU General Public License as published by the
                      7:  * Free Software Foundation; either version 2 of the License, or (at your
                      8:  * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
                      9:  *
                     10:  * This program is distributed in the hope that it will be useful, but
                     11:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
                     12:  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
                     13:  * for more details.
                     14:  */
                     15: 
                     16: #ifndef WINDOWS_THREAD_H_
                     17: #define WINDOWS_THREAD_H_
                     18: 
                     19: /* for conditionVariables, Vista */
                     20: #define _WIN32_WINNT 0x0600
                     21: #include <library.h>
                     22: 
                     23: /**
                     24:  * @defgroup windowsthread windows
                     25:  * @ingroup threading
                     26:  *
                     27:  * @defgroup threadwindows thread
                     28:  * @{ @ingroup windowsthread
                     29:  */
                     30: 
                     31: /**
                     32:  * Set active condvar of a thread before waiting in it.
                     33:  *
                     34:  * @param condvar      active condition variable, NULL to unset
                     35:  */
                     36: void thread_set_active_condvar(CONDITION_VARIABLE *condvar);
                     37: 
                     38: /**
                     39:  * Set a thread specific value on the current thread.
                     40:  *
                     41:  * @param key          unique key specifying the TLS variable
                     42:  * @param value                value to set
                     43:  * @return                     old value for key, if any
                     44:  */
                     45: void* thread_tls_put(void *key, void *value);
                     46: 
                     47: /**
                     48:  * Get a thread specific value from the current thread.
                     49:  *
                     50:  * @param key          unique key specifying the TLS variable
                     51:  * @return                     value for key, if any
                     52:  */
                     53: void* thread_tls_get(void *key);
                     54: 
                     55: /**
                     56:  * Remove a thread specific value from the current thread.
                     57:  *
                     58:  * @param key          unique key specifying the TLS variable
                     59:  * @return                     value for key, if any
                     60:  */
                     61: void* thread_tls_remove(void *key);
                     62: 
                     63: /**
                     64:  * Cleanup function for thread specific value.
                     65:  *
                     66:  * This is called whenever a thread exits to clean up thread specific data.
                     67:  *
                     68:  * This function is actually implemented in thread_value.c.
                     69:  *
                     70:  * @param value                value, as passed to thread_tls_put()
                     71:  */
                     72: void thread_tls_cleanup(void *value);
                     73: 
                     74: #endif /** WINDOWS_THREAD_H_ @}*/

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>