Home | History | Annotate | Line # | Download | only in import
windows-once.h revision 1.1.1.1
      1  1.1  christos /* Once-only control (native Windows implementation).
      2  1.1  christos    Copyright (C) 2005-2020 Free Software Foundation, Inc.
      3  1.1  christos 
      4  1.1  christos    This program is free software; you can redistribute it and/or modify
      5  1.1  christos    it under the terms of the GNU General Public License as published by
      6  1.1  christos    the Free Software Foundation; either version 3, or (at your option)
      7  1.1  christos    any later version.
      8  1.1  christos 
      9  1.1  christos    This program is distributed in the hope that it will be useful,
     10  1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  1.1  christos    GNU General Public License for more details.
     13  1.1  christos 
     14  1.1  christos    You should have received a copy of the GNU General Public License
     15  1.1  christos    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
     16  1.1  christos 
     17  1.1  christos /* Written by Bruno Haible <bruno (at) clisp.org>, 2005.
     18  1.1  christos    Based on GCC's gthr-win32.h.  */
     19  1.1  christos 
     20  1.1  christos #ifndef _WINDOWS_ONCE_H
     21  1.1  christos #define _WINDOWS_ONCE_H
     22  1.1  christos 
     23  1.1  christos #define WIN32_LEAN_AND_MEAN  /* avoid including junk */
     24  1.1  christos #include <windows.h>
     25  1.1  christos 
     26  1.1  christos typedef struct
     27  1.1  christos         {
     28  1.1  christos           volatile int inited;
     29  1.1  christos           volatile LONG started;
     30  1.1  christos           CRITICAL_SECTION lock;
     31  1.1  christos         }
     32  1.1  christos         glwthread_once_t;
     33  1.1  christos 
     34  1.1  christos #define GLWTHREAD_ONCE_INIT { -1, -1 }
     35  1.1  christos 
     36  1.1  christos #ifdef __cplusplus
     37  1.1  christos extern "C" {
     38  1.1  christos #endif
     39  1.1  christos 
     40  1.1  christos extern void glwthread_once (glwthread_once_t *once_control,
     41  1.1  christos                             void (*initfunction) (void));
     42  1.1  christos 
     43  1.1  christos #ifdef __cplusplus
     44  1.1  christos }
     45  1.1  christos #endif
     46  1.1  christos 
     47  1.1  christos #endif /* _WINDOWS_ONCE_H */
     48