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
5002bd21
Commit
5002bd21
authored
Oct 30, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Moved the pthread emulation support to ntdll.
parent
8551c8d5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
15 deletions
+13
-15
Makefile.in
dlls/kernel32/Makefile.in
+0
-1
kernel_private.h
dlls/kernel32/kernel_private.h
+1
-4
process.c
dlls/kernel32/process.c
+0
-2
Makefile.in
dlls/ntdll/Makefile.in
+1
-0
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+3
-1
pthread.c
dlls/ntdll/pthread.c
+7
-7
thread.c
dlls/ntdll/thread.c
+1
-0
No files found.
dlls/kernel32/Makefile.in
View file @
5002bd21
...
...
@@ -51,7 +51,6 @@ C_SRCS = \
powermgnt.c
\
process.c
\
profile.c
\
pthread.c
\
relay16.c
\
resource.c
\
resource16.c
\
...
...
dlls/kernel32/kernel_private.h
View file @
5002bd21
...
...
@@ -30,8 +30,7 @@ struct kernel_thread_data
WORD
htask16
;
/* Win16 task handle */
DWORD
sys_count
[
4
];
/* syslevel mutex entry counters */
struct
tagSYSLEVEL
*
sys_mutex
[
4
];
/* syslevel mutex pointers */
void
*
pthread_data
;
/* private data for pthread emulation */
void
*
pad
[
43
];
/* change this if you add fields! */
void
*
pad
[
44
];
/* change this if you add fields! */
};
static
inline
struct
kernel_thread_data
*
kernel_get_thread_data
(
void
)
...
...
@@ -71,8 +70,6 @@ extern HANDLE dos_handles[DOS_TABLE_SIZE];
extern
const
WCHAR
*
DIR_Windows
;
extern
const
WCHAR
*
DIR_System
;
extern
void
PTHREAD_Init
(
void
);
extern
VOID
SYSLEVEL_CheckNotLevel
(
INT
level
);
extern
void
FILE_SetDosError
(
void
);
...
...
dlls/kernel32/process.c
View file @
5002bd21
...
...
@@ -970,8 +970,6 @@ void __wine_kernel_init(void)
/* Initialize everything */
PTHREAD_Init
();
setbuf
(
stdout
,
NULL
);
setbuf
(
stderr
,
NULL
);
kernel32_handle
=
GetModuleHandleW
(
kernel32W
);
...
...
dlls/ntdll/Makefile.in
View file @
5002bd21
...
...
@@ -30,6 +30,7 @@ C_SRCS = \
om.c
\
path.c
\
process.c
\
pthread.c
\
reg.c
\
relay.c
\
resource.c
\
...
...
dlls/ntdll/ntdll_misc.h
View file @
5002bd21
...
...
@@ -59,6 +59,7 @@ extern size_t get_signal_stack_total_size(void);
extern
void
version_init
(
const
WCHAR
*
appname
);
extern
void
debug_init
(
void
);
extern
HANDLE
thread_init
(
void
);
extern
void
pthread_init
(
void
);
extern
void
actctx_init
(
void
);
extern
void
virtual_init
(
void
);
extern
void
virtual_init_threading
(
void
);
...
...
@@ -180,8 +181,9 @@ struct ntdll_thread_data
int
reply_fd
;
/* 1e4 fd for receiving server replies */
int
wait_fd
[
2
];
/* 1e8 fd for sleeping server requests */
void
*
vm86_ptr
;
/* 1f0 data for vm86 mode */
void
*
pthread_data
;
/* 1f4 private data for pthread emulation */
void
*
pad
[
2
];
/* 1f4
change this if you add fields! */
void
*
pad
[
1
];
/* 1f8
change this if you add fields! */
};
static
inline
struct
ntdll_thread_data
*
ntdll_get_thread_data
(
void
)
...
...
dlls/
kernel32
/pthread.c
→
dlls/
ntdll
/pthread.c
View file @
5002bd21
...
...
@@ -46,7 +46,7 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "
kernel_private
.h"
#include "
ntdll_misc
.h"
#include "wine/pthread.h"
#define P_OUTPUT(stuff) write(2,stuff,strlen(stuff))
...
...
@@ -183,7 +183,7 @@ static void mutex_real_init( pthread_mutex_t *mutex )
CRITICAL_SECTION
*
critsect
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
CRITICAL_SECTION
));
RtlInitializeCriticalSection
(
critsect
);
if
(
InterlockedCompareExchangePointe
r
((
void
**
)
&
(((
wine_mutex
)
mutex
)
->
critsect
),
critsect
,
NULL
)
!=
NULL
)
{
if
(
interlocked_cmpxchg_pt
r
((
void
**
)
&
(((
wine_mutex
)
mutex
)
->
critsect
),
critsect
,
NULL
)
!=
NULL
)
{
/* too late, some other thread already did it */
RtlDeleteCriticalSection
(
critsect
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
critsect
);
...
...
@@ -242,7 +242,7 @@ static void rwlock_real_init(pthread_rwlock_t *rwlock)
RTL_RWLOCK
*
lock
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
RTL_RWLOCK
));
RtlInitializeResource
(
lock
);
if
(
InterlockedCompareExchangePointe
r
((
void
**
)
&
(((
wine_rwlock
)
rwlock
)
->
lock
),
lock
,
NULL
)
!=
NULL
)
{
if
(
interlocked_cmpxchg_pt
r
((
void
**
)
&
(((
wine_rwlock
)
rwlock
)
->
lock
),
lock
,
NULL
)
!=
NULL
)
{
/* too late, some other thread already did it */
RtlDeleteResource
(
lock
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
lock
);
...
...
@@ -363,7 +363,7 @@ static void wine_cond_real_init(pthread_cond_t *cond)
NtCreateEvent
(
&
detail
->
waiters_done
,
EVENT_ALL_ACCESS
,
NULL
,
FALSE
,
FALSE
);
RtlInitializeCriticalSection
(
&
detail
->
waiters_count_lock
);
if
(
InterlockedCompareExchangePointe
r
((
void
**
)
&
(((
wine_cond
)
cond
)
->
cond
),
detail
,
NULL
)
!=
NULL
)
if
(
interlocked_cmpxchg_pt
r
((
void
**
)
&
(((
wine_cond
)
cond
)
->
cond
),
detail
,
NULL
)
!=
NULL
)
{
/* too late, some other thread already did it */
P_OUTPUT
(
"FIXME:pthread_cond_init:expect troubles...
\n
"
);
...
...
@@ -549,12 +549,12 @@ static int wine_pthread_equal(pthread_t thread1, pthread_t thread2)
static
void
*
wine_get_thread_data
(
void
)
{
return
kerne
l_get_thread_data
()
->
pthread_data
;
return
ntdl
l_get_thread_data
()
->
pthread_data
;
}
static
void
wine_set_thread_data
(
void
*
data
)
{
kerne
l_get_thread_data
()
->
pthread_data
=
data
;
ntdl
l_get_thread_data
()
->
pthread_data
=
data
;
}
static
const
struct
wine_pthread_callbacks
callbacks
=
...
...
@@ -590,7 +590,7 @@ static const struct wine_pthread_callbacks callbacks =
static
struct
wine_pthread_functions
pthread_functions
;
void
PTHREAD_I
nit
(
void
)
void
pthread_i
nit
(
void
)
{
wine_pthread_get_functions
(
&
pthread_functions
,
sizeof
(
pthread_functions
)
);
pthread_functions
.
init_process
(
&
callbacks
,
sizeof
(
callbacks
)
);
...
...
dlls/ntdll/thread.c
View file @
5002bd21
...
...
@@ -342,6 +342,7 @@ HANDLE thread_init(void)
user_shared_data
->
TickCountLowDeprecated
=
user_shared_data
->
u
.
TickCount
.
LowPart
;
user_shared_data
->
TickCountMultiplier
=
1
<<
24
;
pthread_init
();
return
exe_file
;
}
...
...
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