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
669b0a52
Commit
669b0a52
authored
Jul 28, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Jul 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Use Interlocked functions for reference counting.
parent
eb3028ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
handle.c
dlls/rsaenh/handle.c
+5
-3
handle.h
dlls/rsaenh/handle.h
+1
-1
No files found.
dlls/rsaenh/handle.c
View file @
669b0a52
...
...
@@ -253,7 +253,7 @@ int alloc_handle(HANDLETABLE *lpTable, OBJECTHDR *lpObject, unsigned int *lpHand
lpTable
->
paEntries
[
lpTable
->
iFirstFree
].
pObject
=
lpObject
;
lpTable
->
iFirstFree
=
lpTable
->
paEntries
[
lpTable
->
iFirstFree
].
iNextFree
;
lpObject
->
refcount
++
;
InterlockedIncrement
(
&
lpObject
->
refcount
)
;
ret
=
1
;
exit:
...
...
@@ -296,10 +296,12 @@ int release_handle(HANDLETABLE *lpTable, unsigned int handle, DWORD dwType)
goto
exit
;
pObject
=
lpTable
->
paEntries
[
index
].
pObject
;
pObject
->
refcount
--
;
if
(
pObject
->
refcount
==
0
)
if
(
InterlockedDecrement
(
&
pObject
->
refcount
)
==
0
)
{
TRACE
(
"destroying handle %d
\n
"
,
handle
);
if
(
pObject
->
destructor
)
pObject
->
destructor
(
pObject
);
}
lpTable
->
paEntries
[
index
].
pObject
=
NULL
;
lpTable
->
paEntries
[
index
].
iNextFree
=
lpTable
->
iFirstFree
;
...
...
dlls/rsaenh/handle.h
View file @
669b0a52
...
...
@@ -36,7 +36,7 @@ typedef void (*DESTRUCTOR)(OBJECTHDR *object);
struct
tagOBJECTHDR
{
DWORD
dwType
;
UINT
refcount
;
LONG
refcount
;
DESTRUCTOR
destructor
;
};
...
...
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