windows-initguard.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Init guards, somewhat like spinlocks (native Windows implementation).
  2. Copyright (C) 2005-2021 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, see <https://www.gnu.org/licenses/>. */
  13. /* Written by Bruno Haible <bruno@clisp.org>, 2005.
  14. Based on GCC's gthr-win32.h. */
  15. #ifndef _WINDOWS_INITGUARD_H
  16. #define _WINDOWS_INITGUARD_H
  17. #define WIN32_LEAN_AND_MEAN /* avoid including junk */
  18. #include <windows.h>
  19. typedef struct
  20. {
  21. volatile int done;
  22. volatile LONG started;
  23. }
  24. glwthread_initguard_t;
  25. #define GLWTHREAD_INITGUARD_INIT { 0, -1 }
  26. #endif /* _WINDOWS_INITGUARD_H */