summaryrefslogtreecommitdiff
path: root/rpmio/rpmsq.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-04-07 12:05:35 +0000
committerjbj <devnull@localhost>2003-04-07 12:05:35 +0000
commitf60ec855de0d6bfd29325fcb73b2901780e72e3d (patch)
treea47ae7163e358f6a60e22f7a05d14ddd43f1690c /rpmio/rpmsq.c
parent0bb715a528359c01b6077f850ab0bc2e0f5e8c55 (diff)
downloadlibrpm-tizen-f60ec855de0d6bfd29325fcb73b2901780e72e3d.tar.gz
librpm-tizen-f60ec855de0d6bfd29325fcb73b2901780e72e3d.tar.bz2
librpm-tizen-f60ec855de0d6bfd29325fcb73b2901780e72e3d.zip
Calibrated stopwatch using rdtsc.
Probes for digest/signature and rpmdb. CVS patchset: 6734 CVS date: 2003/04/07 12:05:35
Diffstat (limited to 'rpmio/rpmsq.c')
-rw-r--r--rpmio/rpmsq.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c
index e676857fa..1c2536ced 100644
--- a/rpmio/rpmsq.c
+++ b/rpmio/rpmsq.c
@@ -449,19 +449,28 @@ fprintf(stderr, " Fini(%p): %p child %d status 0x%x\n", ME(), sq, sq->child
return sq->reaped;
}
-int rpmsqThread(void * (*start) (void * arg), void * arg)
+void * rpmsqThread(void * (*start) (void * arg), void * arg)
{
pthread_t pth;
int ret;
ret = pthread_create(&pth, NULL, start, arg);
- if (ret == 0) {
-#if 0
-fprintf(stderr, " Thread(%p): %p\n", ME(), pth);
-#endif
- ret = pthread_join(pth, NULL);
- }
- return ret;
+ return (ret == 0 ? (void *)pth : NULL);
+}
+
+int rpmsqJoin(void * thread)
+{
+ pthread_t pth = (pthread_t) thread;
+ if (thread == NULL)
+ return EINVAL;
+ return pthread_join(pth, NULL);
+}
+
+int rpmsqThreadEqual(void * thread)
+{
+ pthread_t t1 = (pthread_t) thread;
+ pthread_t t2 = pthread_self();
+ return pthread_equal(t1, t2);
}
/**