Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a283d14b
Commit
a283d14b
authored
Aug 18, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcomp: Implement omp_init_lock and omp_destroy_lock.
parent
ce18a733
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
24 deletions
+47
-24
main.c
dlls/vcomp/main.c
+39
-16
vcomp.spec
dlls/vcomp/vcomp.spec
+2
-2
vcomp100.spec
dlls/vcomp100/vcomp100.spec
+2
-2
vcomp110.spec
dlls/vcomp110/vcomp110.spec
+2
-2
vcomp90.spec
dlls/vcomp90/vcomp90.spec
+2
-2
No files found.
dlls/vcomp/main.c
View file @
a283d14b
...
@@ -34,6 +34,9 @@
...
@@ -34,6 +34,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
vcomp
);
WINE_DEFAULT_DEBUG_CHANNEL
(
vcomp
);
typedef
CRITICAL_SECTION
*
omp_lock_t
;
typedef
CRITICAL_SECTION
*
omp_nest_lock_t
;
static
struct
list
vcomp_idle_threads
=
LIST_INIT
(
vcomp_idle_threads
);
static
struct
list
vcomp_idle_threads
=
LIST_INIT
(
vcomp_idle_threads
);
static
DWORD
vcomp_context_tls
=
TLS_OUT_OF_INDEXES
;
static
DWORD
vcomp_context_tls
=
TLS_OUT_OF_INDEXES
;
static
HMODULE
vcomp_module
;
static
HMODULE
vcomp_module
;
...
@@ -1020,29 +1023,49 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...)
...
@@ -1020,29 +1023,49 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...)
__ms_va_end
(
team_data
.
valist
);
__ms_va_end
(
team_data
.
valist
);
}
}
static
CRITICAL_SECTION
*
alloc_critsect
(
void
)
{
CRITICAL_SECTION
*
critsect
;
if
(
!
(
critsect
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
critsect
))))
{
ERR
(
"could not allocate critical section
\n
"
);
ExitProcess
(
1
);
}
InitializeCriticalSection
(
critsect
);
critsect
->
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": critsect"
);
return
critsect
;
}
static
void
destroy_critsect
(
CRITICAL_SECTION
*
critsect
)
{
if
(
!
critsect
)
return
;
critsect
->
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
critsect
);
HeapFree
(
GetProcessHeap
(),
0
,
critsect
);
}
void
CDECL
omp_init_lock
(
omp_lock_t
*
lock
)
{
TRACE
(
"(%p)
\n
"
,
lock
);
*
lock
=
alloc_critsect
();
}
void
CDECL
omp_destroy_lock
(
omp_lock_t
*
lock
)
{
TRACE
(
"(%p)
\n
"
,
lock
);
destroy_critsect
(
*
lock
);
}
void
CDECL
_vcomp_enter_critsect
(
CRITICAL_SECTION
**
critsect
)
void
CDECL
_vcomp_enter_critsect
(
CRITICAL_SECTION
**
critsect
)
{
{
TRACE
(
"(%p)
\n
"
,
critsect
);
TRACE
(
"(%p)
\n
"
,
critsect
);
if
(
!*
critsect
)
if
(
!*
critsect
)
{
{
CRITICAL_SECTION
*
new_critsect
;
CRITICAL_SECTION
*
new_critsect
=
alloc_critsect
();
if
(
!
(
new_critsect
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
new_critsect
))))
{
ERR
(
"could not allocate critical section
\n
"
);
ExitProcess
(
1
);
}
InitializeCriticalSection
(
new_critsect
);
new_critsect
->
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": critsect"
);
if
(
interlocked_cmpxchg_ptr
((
void
**
)
critsect
,
new_critsect
,
NULL
)
!=
NULL
)
if
(
interlocked_cmpxchg_ptr
((
void
**
)
critsect
,
new_critsect
,
NULL
)
!=
NULL
)
{
destroy_critsect
(
new_critsect
);
/* someone beat us to it */
/* someone beat us to it */
new_critsect
->
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
new_critsect
);
HeapFree
(
GetProcessHeap
(),
0
,
new_critsect
);
}
}
}
EnterCriticalSection
(
*
critsect
);
EnterCriticalSection
(
*
critsect
);
...
...
dlls/vcomp/vcomp.spec
View file @
a283d14b
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
@ cdecl _vcomp_set_num_threads(long)
@ cdecl _vcomp_set_num_threads(long)
@ cdecl _vcomp_single_begin(long)
@ cdecl _vcomp_single_begin(long)
@ cdecl _vcomp_single_end()
@ cdecl _vcomp_single_end()
@
stub omp_destroy_lock
@
cdecl omp_destroy_lock(ptr)
@ stub omp_destroy_nest_lock
@ stub omp_destroy_nest_lock
@ cdecl omp_get_dynamic()
@ cdecl omp_get_dynamic()
@ cdecl omp_get_max_threads()
@ cdecl omp_get_max_threads()
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
@ stub omp_get_wtick
@ stub omp_get_wtick
@ cdecl omp_get_wtime()
@ cdecl omp_get_wtime()
@ cdecl omp_in_parallel()
@ cdecl omp_in_parallel()
@
stub omp_init_lock
@
cdecl omp_init_lock(ptr)
@ stub omp_init_nest_lock
@ stub omp_init_nest_lock
@ cdecl omp_set_dynamic(long)
@ cdecl omp_set_dynamic(long)
@ stub omp_set_lock
@ stub omp_set_lock
...
...
dlls/vcomp100/vcomp100.spec
View file @
a283d14b
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
@
stub
omp_destroy_lock
@
cdecl omp_destroy_lock(ptr) vcomp.
omp_destroy_lock
@ stub omp_destroy_nest_lock
@ stub omp_destroy_nest_lock
@ cdecl omp_get_dynamic() vcomp.omp_get_dynamic
@ cdecl omp_get_dynamic() vcomp.omp_get_dynamic
@ cdecl omp_get_max_threads() vcomp.omp_get_max_threads
@ cdecl omp_get_max_threads() vcomp.omp_get_max_threads
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
@ stub omp_get_wtick
@ stub omp_get_wtick
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
@
stub
omp_init_lock
@
cdecl omp_init_lock(ptr) vcomp.
omp_init_lock
@ stub omp_init_nest_lock
@ stub omp_init_nest_lock
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ stub omp_set_lock
@ stub omp_set_lock
...
...
dlls/vcomp110/vcomp110.spec
View file @
a283d14b
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
@
stub
omp_destroy_lock
@
cdecl omp_destroy_lock(ptr) vcomp.
omp_destroy_lock
@ stub omp_destroy_nest_lock
@ stub omp_destroy_nest_lock
@ cdecl omp_get_dynamic() vcomp.omp_get_dynamic
@ cdecl omp_get_dynamic() vcomp.omp_get_dynamic
@ cdecl omp_get_max_threads() vcomp.omp_get_max_threads
@ cdecl omp_get_max_threads() vcomp.omp_get_max_threads
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
@ stub omp_get_wtick
@ stub omp_get_wtick
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
@
stub
omp_init_lock
@
cdecl omp_init_lock(ptr) vcomp.
omp_init_lock
@ stub omp_init_nest_lock
@ stub omp_init_nest_lock
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ stub omp_set_lock
@ stub omp_set_lock
...
...
dlls/vcomp90/vcomp90.spec
View file @
a283d14b
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_set_num_threads(long) vcomp._vcomp_set_num_threads
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_begin(long) vcomp._vcomp_single_begin
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
@ cdecl _vcomp_single_end() vcomp._vcomp_single_end
@
stub
omp_destroy_lock
@
cdecl omp_destroy_lock(ptr) vcomp.
omp_destroy_lock
@ stub omp_destroy_nest_lock
@ stub omp_destroy_nest_lock
@ cdecl omp_get_dynamic() vcomp.omp_get_dynamic
@ cdecl omp_get_dynamic() vcomp.omp_get_dynamic
@ cdecl omp_get_max_threads() vcomp.omp_get_max_threads
@ cdecl omp_get_max_threads() vcomp.omp_get_max_threads
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
@ stub omp_get_wtick
@ stub omp_get_wtick
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
@ cdecl omp_get_wtime() vcomp.omp_get_wtime
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
@ cdecl omp_in_parallel() vcomp.omp_in_parallel
@
stub
omp_init_lock
@
cdecl omp_init_lock(ptr) vcomp.
omp_init_lock
@ stub omp_init_nest_lock
@ stub omp_init_nest_lock
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ cdecl omp_set_dynamic(long) vcomp.omp_set_dynamic
@ stub omp_set_lock
@ stub omp_set_lock
...
...
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