18dffb485Schristos /* Init guards, somewhat like spinlocks (native Windows implementation). 2*4b169a6bSchristos Copyright (C) 2005-2022 Free Software Foundation, Inc. 38dffb485Schristos 4*4b169a6bSchristos This file is free software: you can redistribute it and/or modify 5*4b169a6bSchristos it under the terms of the GNU Lesser General Public License as 6*4b169a6bSchristos published by the Free Software Foundation; either version 2.1 of the 7*4b169a6bSchristos License, or (at your option) any later version. 88dffb485Schristos 9*4b169a6bSchristos This file is distributed in the hope that it will be useful, 108dffb485Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 118dffb485Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12*4b169a6bSchristos GNU Lesser General Public License for more details. 138dffb485Schristos 14*4b169a6bSchristos You should have received a copy of the GNU Lesser General Public License 15*4b169a6bSchristos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 168dffb485Schristos 178dffb485Schristos /* Written by Bruno Haible <bruno@clisp.org>, 2005. 188dffb485Schristos Based on GCC's gthr-win32.h. */ 198dffb485Schristos 208dffb485Schristos #ifndef _WINDOWS_INITGUARD_H 218dffb485Schristos #define _WINDOWS_INITGUARD_H 228dffb485Schristos 238dffb485Schristos #define WIN32_LEAN_AND_MEAN /* avoid including junk */ 248dffb485Schristos #include <windows.h> 258dffb485Schristos 268dffb485Schristos typedef struct 278dffb485Schristos { 288dffb485Schristos volatile int done; 298dffb485Schristos volatile LONG started; 308dffb485Schristos } 318dffb485Schristos glwthread_initguard_t; 328dffb485Schristos 338dffb485Schristos #define GLWTHREAD_INITGUARD_INIT { 0, -1 } 348dffb485Schristos 358dffb485Schristos #endif /* _WINDOWS_INITGUARD_H */ 36