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
34bf8158
Commit
34bf8158
authored
Mar 21, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of SYSTEM_LOCK macros.
parent
14200e2b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
29 deletions
+14
-29
heap.h
include/heap.h
+0
-9
heap.c
memory/heap.c
+1
-6
utthunk.c
relay32/utthunk.c
+4
-4
queue.c
windows/queue.c
+9
-10
No files found.
include/heap.h
View file @
34bf8158
...
...
@@ -11,7 +11,6 @@
extern
HANDLE
SystemHeap
;
extern
HANDLE
SegptrHeap
;
extern
CRITICAL_SECTION
*
HEAP_SystemLock
;
extern
int
HEAP_IsInsideHeap
(
HANDLE
heap
,
DWORD
flags
,
LPCVOID
ptr
);
extern
SEGPTR
HEAP_GetSegptr
(
HANDLE
heap
,
DWORD
flags
,
LPCVOID
ptr
);
...
...
@@ -39,14 +38,6 @@ static __inline__ SEGPTR WINE_UNUSED SEGPTR_Get(LPCVOID ptr) {
#define SEGPTR_FREE(ptr) \
(HIWORD(ptr) ? HeapFree( SegptrHeap, 0, (ptr) ) : 0)
/* System heap locking macros */
#define SYSTEM_LOCK() (EnterCriticalSection(HEAP_SystemLock))
#define SYSTEM_UNLOCK() (LeaveCriticalSection(HEAP_SystemLock))
/* Use this one only when you own the lock! */
#define SYSTEM_LOCK_COUNT() (HEAP_SystemLock->RecursionCount)
typedef
struct
{
LPVOID
lpData
;
...
...
memory/heap.c
View file @
34bf8158
...
...
@@ -97,7 +97,6 @@ typedef struct tagHEAP
HANDLE
SystemHeap
=
0
;
HANDLE
SegptrHeap
=
0
;
CRITICAL_SECTION
*
HEAP_SystemLock
=
NULL
;
/***********************************************************************
...
...
@@ -508,13 +507,9 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
/* Initialize critical section */
InitializeCriticalSection
(
&
heap
->
critSection
);
if
(
!
SystemHeap
)
{
HEAP_SystemLock
=
&
heap
->
critSection
;
/* System heap critical section has to be global */
if
(
!
SystemHeap
)
/* System heap critical section has to be global */
MakeCriticalSectionGlobal
(
&
heap
->
critSection
);
}
}
/* Create the first free block */
...
...
relay32/utthunk.c
View file @
34bf8158
...
...
@@ -216,12 +216,12 @@ BOOL WINAPI UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL,
/* Allocate UTINFO struct */
SYSTEM_LOCK
();
HeapLock
(
SegptrHeap
);
/* FIXME: a bit overkill */
if
(
(
ut
=
UTFind
(
hModule
))
!=
NULL
)
ut
=
NULL
;
else
ut
=
UTAlloc
(
hModule
,
hModule16
,
target16
,
pfnUT32CallBack
);
SYSTEM_UNLOCK
(
);
HeapUnlock
(
SegptrHeap
);
if
(
!
ut
)
{
...
...
@@ -261,14 +261,14 @@ VOID WINAPI UTUnRegister( HMODULE hModule )
UTINFO
*
ut
;
HMODULE16
hModule16
=
0
;
SYSTEM_LOCK
();
HeapLock
(
SegptrHeap
);
/* FIXME: a bit overkill */
ut
=
UTFind
(
hModule
);
if
(
!
ut
)
{
hModule16
=
ut
->
hModule16
;
UTFree
(
ut
);
}
SYSTEM_UNLOCK
(
);
HeapUnlock
(
SegptrHeap
);
if
(
hModule16
)
FreeLibrary16
(
hModule16
);
...
...
windows/queue.c
View file @
34bf8158
...
...
@@ -305,17 +305,16 @@ MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue )
{
MESSAGEQUEUE
*
queue
;
SYSTEM_LOCK
();
HeapLock
(
SystemHeap
);
/* FIXME: a bit overkill */
queue
=
GlobalLock16
(
hQueue
);
if
(
!
queue
||
(
queue
->
magic
!=
QUEUE_MAGIC
)
)
{
SYSTEM_UNLOCK
(
);
HeapUnlock
(
SystemHeap
);
return
NULL
;
}
queue
->
lockCount
++
;
SYSTEM_UNLOCK
();
HeapUnlock
(
SystemHeap
);
return
queue
;
}
...
...
@@ -330,7 +329,7 @@ void QUEUE_Unlock( MESSAGEQUEUE *queue )
{
if
(
queue
)
{
SYSTEM_LOCK
();
HeapLock
(
SystemHeap
);
/* FIXME: a bit overkill */
if
(
--
queue
->
lockCount
==
0
)
{
...
...
@@ -340,7 +339,7 @@ void QUEUE_Unlock( MESSAGEQUEUE *queue )
GlobalFree16
(
queue
->
self
);
}
SYSTEM_UNLOCK
(
);
HeapUnlock
(
SystemHeap
);
}
}
...
...
@@ -547,7 +546,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
/* flush sent messages */
QUEUE_FlushMessages
(
msgQueue
);
SYSTEM_LOCK
();
HeapLock
(
SystemHeap
);
/* FIXME: a bit overkill */
/* Release per queue data if present */
if
(
msgQueue
->
pQData
)
...
...
@@ -575,7 +574,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
if
(
pPrev
&&
*
pPrev
)
*
pPrev
=
msgQueue
->
next
;
msgQueue
->
self
=
0
;
SYSTEM_UNLOCK
(
);
HeapUnlock
(
SystemHeap
);
/* free up resource used by MESSAGEQUEUE strcture */
msgQueue
->
lockCount
--
;
...
...
@@ -1401,13 +1400,13 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags )
queuePtr
=
(
MESSAGEQUEUE
*
)
QUEUE_Lock
(
hQueue
);
queuePtr
->
thdb
=
THREAD_Current
();
SYSTEM_LOCK
();
HeapLock
(
SystemHeap
);
/* FIXME: a bit overkill */
SetThreadQueue16
(
0
,
hQueue
);
thdb
->
teb
.
queue
=
hQueue
;
queuePtr
->
next
=
hFirstQueue
;
hFirstQueue
=
hQueue
;
SYSTEM_UNLOCK
(
);
HeapUnlock
(
SystemHeap
);
QUEUE_Unlock
(
queuePtr
);
}
...
...
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