Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
425af5f6
Commit
425af5f6
authored
Oct 15, 2016
by
Josh Gargus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a recursive mutex.
parent
87a83d68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
ossource.cpp
glslang/OSDependent/Unix/ossource.cpp
+21
-4
No files found.
glslang/OSDependent/Unix/ossource.cpp
View file @
425af5f6
...
...
@@ -165,10 +165,27 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
return
false
;
}
static
pthread_mutex_t
gMutex
;
void
InitGlobalLock
()
{
pthread_mutex_init
(
&
gMutex
,
NULL
);
}
void
GetGlobalLock
()
{
pthread_mutex_lock
(
&
gMutex
);
}
void
ReleaseGlobalLock
()
{
pthread_mutex_unlock
(
&
gMutex
);
}
namespace
{
pthread_mutex_t
gMutex
;
}
void
InitGlobalLock
()
{
pthread_mutexattr_t
mutexattr
;
pthread_mutexattr_init
(
&
mutexattr
);
pthread_mutexattr_settype
(
&
mutexattr
,
PTHREAD_MUTEX_RECURSIVE
);
pthread_mutex_init
(
&
gMutex
,
&
mutexattr
);
}
void
GetGlobalLock
()
{
pthread_mutex_lock
(
&
gMutex
);
}
void
ReleaseGlobalLock
()
{
pthread_mutex_unlock
(
&
gMutex
);
}
// TODO: non-windows: if we need these on linux, flesh them out
void
*
OS_CreateThread
(
TThreadEntrypoint
/*entry*/
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment