Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glslang
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
deqp-deps
glslang
Commits
c6584978
Commit
c6584978
authored
8 years ago
by
John Kessenich
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #539 from schwa423/linux_global_lock
Use pthread_mutex for global lock on Linux.
parents
1b6daa04
425af5f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
glslang/OSDependent/Unix/ossource.cpp
+22
-4
22 additions, 4 deletions
glslang/OSDependent/Unix/ossource.cpp
with
22 additions
and
4 deletions
glslang/OSDependent/Unix/ossource.cpp
+
22
−
4
View file @
c6584978
...
...
@@ -165,11 +165,29 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
return
false
;
}
// TODO: non-windows: if we need these on linux, flesh them out
void
InitGlobalLock
()
{
}
void
GetGlobalLock
()
{
}
void
ReleaseGlobalLock
()
{
}
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*/
)
{
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment