Home | History | Annotate | Line # | Download | only in import
windows-once.h revision 1.1.1.1.2.1
      1          1.1  christos /* Once-only control (native Windows implementation).
      2  1.1.1.1.2.1  perseant    Copyright (C) 2005-2022 Free Software Foundation, Inc.
      3          1.1  christos 
      4  1.1.1.1.2.1  perseant    This file is free software: you can redistribute it and/or modify
      5  1.1.1.1.2.1  perseant    it under the terms of the GNU Lesser General Public License as
      6  1.1.1.1.2.1  perseant    published by the Free Software Foundation; either version 2.1 of the
      7  1.1.1.1.2.1  perseant    License, or (at your option) any later version.
      8          1.1  christos 
      9  1.1.1.1.2.1  perseant    This file 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.1.1.2.1  perseant    GNU Lesser General Public License for more details.
     13          1.1  christos 
     14  1.1.1.1.2.1  perseant    You should have received a copy of the GNU Lesser General Public License
     15  1.1.1.1.2.1  perseant    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