Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
65083774
Commit
65083774
authored
21 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Restore NT4 compatibility, avoid W2K-only API
parent
38025e96
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap_r/thr_nt.c
+28
-6
28 additions, 6 deletions
libraries/libldap_r/thr_nt.c
with
28 additions
and
6 deletions
libraries/libldap_r/thr_nt.c
+
28
−
6
View file @
65083774
...
...
@@ -20,6 +20,19 @@
#include
"ldap_pvt_thread.h"
typedef
struct
ldap_int_thread_s
{
long
tid
;
HANDLE
thd
;
}
ldap_int_thread_s
;
#ifndef NT_MAX_THREADS
#define NT_MAX_THREADS 1024
#endif
static
ldap_int_thread_s
tid
[
NT_MAX_THREADS
];
static
int
ntids
;
/* mingw compiler very sensitive about getting prototypes right */
typedef
unsigned
__stdcall
thrfunc_t
(
void
*
);
...
...
@@ -50,7 +63,9 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
if
(
thd
)
{
*
thread
=
(
ldap_pvt_thread_t
)
tid
;
CloseHandle
(
thd
);
tid
[
ntids
].
tid
=
tid
;
tid
[
ntids
].
thd
=
thd
;
ntids
++
;
rc
=
0
;
}
return
rc
;
...
...
@@ -66,12 +81,19 @@ int
ldap_pvt_thread_join
(
ldap_pvt_thread_t
thread
,
void
**
thread_return
)
{
DWORD
status
;
HANDLE
thd
;
HANDLE
__stdcall
OpenThread
(
int
,
int
,
int
);
int
i
;
thd
=
OpenThread
(
SYNCHRONIZE
,
0
,
thread
);
status
=
WaitForSingleObject
(
thd
,
INFINITE
);
CloseHandle
(
thd
);
for
(
i
=
0
;
i
<
ntids
;
i
++
)
{
if
(
tid
[
i
].
tid
==
thread
)
break
;
}
if
(
i
>
ntids
)
return
-
1
;
status
=
WaitForSingleObject
(
tid
[
i
].
thd
,
INFINITE
);
for
(;
i
<
ntids
;
i
++
)
{
tid
[
i
]
=
tid
[
i
+
1
];
}
ntids
--
;
return
status
==
WAIT_FAILED
?
-
1
:
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment