Go to the SVN repository for this file.
1 #ifndef CONNECT___NCBI_ONCE__H 2 #define CONNECT___NCBI_ONCE__H 4 /* $Id: ncbi_once.h 102683 2024-06-25 21:06:00Z lavr $ 5 * =========================================================================== 8 * National Center for Biotechnology Information 10 * This software/database is a "United States Government Work" under the 11 * terms of the United States Copyright Act. It was written as part of 12 * the author's official duties as a United States Government employee and 13 * thus cannot be copyrighted. This software/database is freely available 14 * to the public for use. The National Library of Medicine and the U.S. 15 * Government have not placed any restriction on its use or reproduction. 17 * Although all reasonable efforts have been taken to ensure the accuracy 18 * and reliability of the software and data, the NLM and the U.S. 19 * Government do not and cannot warrant the performance or results that 20 * may be obtained by using this software or data. The NLM and the U.S. 21 * Government disclaim all warranties, express or implied, including 22 * warranties of performance, merchantability or fitness for any particular 25 * Please cite the author in any work or product based on this material. 27 * =========================================================================== 29 * Authors: Anton Lavrentiev 32 * One time setter CORE_Once 37 #ifdef NCBI_CXX_TOOLKIT 39 #endif /*NCBI_CXX_TOOLKIT*/ 43 /** Return non-zero (true) if "*once" had a value of NULL, and set the value to 44 * non-NULL regardless (best effort: atomically). Return 0 (false) otherwise. 46 #ifdef NCBI_CXX_TOOLKIT 47 # define CORE_Once(once) (!NCBI_SwapPointers((once), (void*) 1)) 52 static int/*bool*/ CORE_Once(
void*
volatile* once)
54 /* poor man's solution */ 66 #endif /*NCBI_CXX_TOOLKIT*/ 69 #endif /* CONNECT___NCBI_ONCE__H */#define CORE_Once(once)
Return non-zero (true) if "*once" had a value of NULL, and set the value to non-NULL regardless (best...
Multi-threading â atomic pointer exchange function.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4