2023-08-03 17:30:57 +02:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard
|
|
|
|
// SPDX-FileCopyrightText: 2006-2017 Camilla Löwy <elmindreda@glfw.org>
|
|
|
|
// SPDX-FileCopyrightText: 2023 The Ebitengine Authors
|
2023-07-05 03:51:55 +02:00
|
|
|
|
2023-07-12 20:32:28 +02:00
|
|
|
//go:build darwin || freebsd || linux || netbsd || openbsd
|
|
|
|
|
2023-07-05 03:51:55 +02:00
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
#define _GLFW_PLATFORM_TLS_STATE _GLFWtlsPOSIX posix
|
|
|
|
#define _GLFW_PLATFORM_MUTEX_STATE _GLFWmutexPOSIX posix
|
|
|
|
|
|
|
|
|
|
|
|
// POSIX-specific thread local storage data
|
|
|
|
//
|
|
|
|
typedef struct _GLFWtlsPOSIX
|
|
|
|
{
|
|
|
|
GLFWbool allocated;
|
|
|
|
pthread_key_t key;
|
|
|
|
} _GLFWtlsPOSIX;
|
|
|
|
|
|
|
|
// POSIX-specific mutex data
|
|
|
|
//
|
|
|
|
typedef struct _GLFWmutexPOSIX
|
|
|
|
{
|
|
|
|
GLFWbool allocated;
|
|
|
|
pthread_mutex_t handle;
|
|
|
|
} _GLFWmutexPOSIX;
|
|
|
|
|