diff options
author | Jeremy Allison <jra@samba.org> | 2009-04-08 15:46:49 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-04-08 15:46:49 -0700 |
commit | e5702da72c752e913ff869bce341ca9799d10974 (patch) | |
tree | 8aa3d46e6b38bb272d0b1afb4c19231d29fd7167 /lib/util/smb_threads_internal.h | |
parent | d8a6ea8141fba4876b6674806b629748ecf41876 (diff) | |
download | samba-e5702da72c752e913ff869bce341ca9799d10974.tar.gz |
Add the thread functions to top level lib/util.
Not yet used, that's the next step.
Jeremy.
Diffstat (limited to 'lib/util/smb_threads_internal.h')
-rw-r--r-- | lib/util/smb_threads_internal.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/util/smb_threads_internal.h b/lib/util/smb_threads_internal.h new file mode 100644 index 00000000000..3208bc27e13 --- /dev/null +++ b/lib/util/smb_threads_internal.h @@ -0,0 +1,52 @@ +/* + SMB/CIFS implementation. + SMB thread interface internal macros. + Copyright (C) Jeremy Allison, 2009. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _smb_threads_internal_h_ +#define _smb_threads_internal_h_ + +#define SMB_THREAD_CREATE_MUTEX(name, lockvar) \ + (global_tfp ? global_tfp->create_mutex((name), &(lockvar), __location__) : 0) + +#define SMB_THREAD_DESTROY_MUTEX(plock) \ + do { \ + if (global_tfp) { \ + global_tfp->destroy_mutex(plock, __location__); \ + }; \ + } while (0) + +#define SMB_THREAD_LOCK(plock, type) \ + (global_tfp ? global_tfp->lock_mutex((plock), (type), __location__) : 0) + +#define SMB_THREAD_CREATE_TLS(keyname, key) \ + (global_tfp ? global_tfp->create_tls((keyname), &(key), __location__) : 0) + +#define SMB_THREAD_DESTROY_TLS(key) \ + do { \ + if (global_tfp) { \ + global_tfp->destroy_tls(key); \ + }; \ + } while (0) + +#define SMB_THREAD_SET_TLS(key, val) \ + (global_tfp ? global_tfp->set_tls((key),(val),__location__) : 0) + +#define SMB_THREAD_GET_TLS(key) \ + (global_tfp ? global_tfp->get_tls((key), __location__) : NULL) + +#endif |