Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5e1cbcce
Commit
5e1cbcce
authored
Nov 02, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp90: Use critical sections in mutex object.
parent
0280c5fb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
19 deletions
+57
-19
misc.c
dlls/msvcp100/misc.c
+14
-4
msvcp.h
dlls/msvcp100/msvcp.h
+1
-1
misc.c
dlls/msvcp60/misc.c
+12
-4
misc.c
dlls/msvcp71/misc.c
+14
-4
msvcp.h
dlls/msvcp71/msvcp.h
+1
-1
misc.c
dlls/msvcp90/misc.c
+14
-4
msvcp90.h
dlls/msvcp90/msvcp90.h
+1
-1
No files found.
dlls/msvcp100/misc.c
View file @
5e1cbcce
...
...
@@ -33,7 +33,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
DEFINE_THISCALL_WRAPPER
(
mutex_ctor
,
4
)
mutex
*
__thiscall
mutex_ctor
(
mutex
*
this
)
{
this
->
mutex
=
CreateMutexW
(
NULL
,
FALSE
,
NULL
);
CRITICAL_SECTION
*
cs
=
MSVCRT_operator_new
(
sizeof
(
*
cs
));
if
(
!
cs
)
{
ERR
(
"Out of memory
\n
"
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
}
InitializeCriticalSection
(
cs
);
cs
->
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": _Mutex critical section"
);
this
->
mutex
=
cs
;
return
this
;
}
...
...
@@ -42,7 +50,9 @@ mutex* __thiscall mutex_ctor(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_dtor
,
4
)
void
__thiscall
mutex_dtor
(
mutex
*
this
)
{
CloseHandle
(
this
->
mutex
);
((
CRITICAL_SECTION
*
)
this
->
mutex
)
->
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
this
->
mutex
);
MSVCRT_operator_delete
(
this
->
mutex
);
}
/* ?_Lock@_Mutex@std@@QAEXXZ */
...
...
@@ -50,7 +60,7 @@ void __thiscall mutex_dtor(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_lock
,
4
)
void
__thiscall
mutex_lock
(
mutex
*
this
)
{
WaitForSingleObject
(
this
->
mutex
,
INFINITE
);
EnterCriticalSection
(
this
->
mutex
);
}
/* ?_Unlock@_Mutex@std@@QAEXXZ */
...
...
@@ -58,7 +68,7 @@ void __thiscall mutex_lock(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_unlock
,
4
)
void
__thiscall
mutex_unlock
(
mutex
*
this
)
{
ReleaseMutex
(
this
->
mutex
);
LeaveCriticalSection
(
this
->
mutex
);
}
/* ?_Mutex_Lock@_Mutex@std@@CAXPAV12@@Z */
...
...
dlls/msvcp100/msvcp.h
View file @
5e1cbcce
...
...
@@ -205,7 +205,7 @@ void __thiscall _Lockit_dtor(_Lockit*);
/* class mutex */
typedef
struct
{
void
*
mutex
;
void
*
mutex
;
}
mutex
;
mutex
*
__thiscall
mutex_ctor
(
mutex
*
);
...
...
dlls/msvcp60/misc.c
View file @
5e1cbcce
...
...
@@ -31,7 +31,13 @@
/* ??0_Mutex@std@@QEAA@XZ */
mutex
*
mutex_ctor
(
mutex
*
this
)
{
this
->
mutex
=
CreateMutexW
(
NULL
,
FALSE
,
NULL
);
CRITICAL_SECTION
*
cs
=
MSVCRT_operator_new
(
sizeof
(
*
cs
));
if
(
!
cs
)
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
InitializeCriticalSection
(
cs
);
cs
->
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": _Mutex critical section"
);
this
->
mutex
=
cs
;
return
this
;
}
...
...
@@ -39,21 +45,23 @@ mutex* mutex_ctor(mutex *this)
/* ??1_Mutex@std@@QEAA@XZ */
void
mutex_dtor
(
mutex
*
this
)
{
CloseHandle
(
this
->
mutex
);
((
CRITICAL_SECTION
*
)
this
->
mutex
)
->
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
this
->
mutex
);
MSVCRT_operator_delete
(
this
->
mutex
);
}
/* ?_Lock@_Mutex@std@@QAEXXZ */
/* ?_Lock@_Mutex@std@@QEAAXXZ */
void
mutex_lock
(
mutex
*
this
)
{
WaitForSingleObject
(
this
->
mutex
,
INFINITE
);
EnterCriticalSection
(
this
->
mutex
);
}
/* ?_Unlock@_Mutex@std@@QAEXXZ */
/* ?_Unlock@_Mutex@std@@QEAAXXZ */
void
mutex_unlock
(
mutex
*
this
)
{
ReleaseMutex
(
this
->
mutex
);
LeaveCriticalSection
(
this
->
mutex
);
}
static
CRITICAL_SECTION
lockit_cs
;
...
...
dlls/msvcp71/misc.c
View file @
5e1cbcce
...
...
@@ -33,7 +33,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
DEFINE_THISCALL_WRAPPER
(
mutex_ctor
,
4
)
mutex
*
__thiscall
mutex_ctor
(
mutex
*
this
)
{
this
->
mutex
=
CreateMutexW
(
NULL
,
FALSE
,
NULL
);
CRITICAL_SECTION
*
cs
=
MSVCRT_operator_new
(
sizeof
(
*
cs
));
if
(
!
cs
)
{
ERR
(
"Out of memory
\n
"
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
}
InitializeCriticalSection
(
cs
);
cs
->
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": _Mutex critical section"
);
this
->
mutex
=
cs
;
return
this
;
}
...
...
@@ -42,7 +50,9 @@ mutex* __thiscall mutex_ctor(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_dtor
,
4
)
void
__thiscall
mutex_dtor
(
mutex
*
this
)
{
CloseHandle
(
this
->
mutex
);
((
CRITICAL_SECTION
*
)
this
->
mutex
)
->
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
this
->
mutex
);
MSVCRT_operator_delete
(
this
->
mutex
);
}
/* ?_Lock@_Mutex@std@@QAEXXZ */
...
...
@@ -50,7 +60,7 @@ void __thiscall mutex_dtor(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_lock
,
4
)
void
__thiscall
mutex_lock
(
mutex
*
this
)
{
WaitForSingleObject
(
this
->
mutex
,
INFINITE
);
EnterCriticalSection
(
this
->
mutex
);
}
/* ?_Unlock@_Mutex@std@@QAEXXZ */
...
...
@@ -58,7 +68,7 @@ void __thiscall mutex_lock(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_unlock
,
4
)
void
__thiscall
mutex_unlock
(
mutex
*
this
)
{
ReleaseMutex
(
this
->
mutex
);
LeaveCriticalSection
(
this
->
mutex
);
}
static
CRITICAL_SECTION
lockit_cs
[
_MAX_LOCK
];
...
...
dlls/msvcp71/msvcp.h
View file @
5e1cbcce
...
...
@@ -201,7 +201,7 @@ void __thiscall _Lockit_dtor(_Lockit*);
/* class mutex */
typedef
struct
{
void
*
mutex
;
void
*
mutex
;
}
mutex
;
mutex
*
__thiscall
mutex_ctor
(
mutex
*
);
...
...
dlls/msvcp90/misc.c
View file @
5e1cbcce
...
...
@@ -33,7 +33,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
DEFINE_THISCALL_WRAPPER
(
mutex_ctor
,
4
)
mutex
*
__thiscall
mutex_ctor
(
mutex
*
this
)
{
this
->
mutex
=
CreateMutexW
(
NULL
,
FALSE
,
NULL
);
CRITICAL_SECTION
*
cs
=
MSVCRT_operator_new
(
sizeof
(
*
cs
));
if
(
!
cs
)
{
ERR
(
"Out of memory
\n
"
);
throw_exception
(
EXCEPTION_BAD_ALLOC
,
NULL
);
}
InitializeCriticalSection
(
cs
);
cs
->
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": _Mutex critical section"
);
this
->
mutex
=
cs
;
return
this
;
}
...
...
@@ -42,7 +50,9 @@ mutex* __thiscall mutex_ctor(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_dtor
,
4
)
void
__thiscall
mutex_dtor
(
mutex
*
this
)
{
CloseHandle
(
this
->
mutex
);
((
CRITICAL_SECTION
*
)
this
->
mutex
)
->
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
this
->
mutex
);
MSVCRT_operator_delete
(
this
->
mutex
);
}
/* ?_Lock@_Mutex@std@@QAEXXZ */
...
...
@@ -50,7 +60,7 @@ void __thiscall mutex_dtor(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_lock
,
4
)
void
__thiscall
mutex_lock
(
mutex
*
this
)
{
WaitForSingleObject
(
this
->
mutex
,
INFINITE
);
EnterCriticalSection
(
this
->
mutex
);
}
/* ?_Unlock@_Mutex@std@@QAEXXZ */
...
...
@@ -58,7 +68,7 @@ void __thiscall mutex_lock(mutex *this)
DEFINE_THISCALL_WRAPPER
(
mutex_unlock
,
4
)
void
__thiscall
mutex_unlock
(
mutex
*
this
)
{
ReleaseMutex
(
this
->
mutex
);
LeaveCriticalSection
(
this
->
mutex
);
}
/* ?_Mutex_Lock@_Mutex@std@@CAXPAV12@@Z */
...
...
dlls/msvcp90/msvcp90.h
View file @
5e1cbcce
...
...
@@ -201,7 +201,7 @@ void __thiscall _Lockit_dtor(_Lockit*);
/* class mutex */
typedef
struct
{
void
*
mutex
;
void
*
mutex
;
}
mutex
;
mutex
*
__thiscall
mutex_ctor
(
mutex
*
);
...
...
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