summaryrefslogtreecommitdiff
path: root/otherlibs/systhreads/st_stubs.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2011-12-13 15:21:14 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2011-12-13 15:21:14 +0000
commitd187828b8cab7db61101e9cea09fb035df96cf74 (patch)
tree4c61d1db02a86957ced9b7aed4d98a6acf4ec0e1 /otherlibs/systhreads/st_stubs.c
parentee3150123290bbc15b4224addc8c6136dfee6f80 (diff)
downloadocaml-d187828b8cab7db61101e9cea09fb035df96cf74.tar.gz
PR#5306: comparing values of type Thread.t
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11303 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/systhreads/st_stubs.c')
-rw-r--r--otherlibs/systhreads/st_stubs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/otherlibs/systhreads/st_stubs.c b/otherlibs/systhreads/st_stubs.c
index 6435aebf3b..abf055b175 100644
--- a/otherlibs/systhreads/st_stubs.c
+++ b/otherlibs/systhreads/st_stubs.c
@@ -836,10 +836,17 @@ static void caml_threadstatus_finalize(value wrapper)
st_event_destroy(Threadstatus_val(wrapper));
}
+static int caml_threadstatus_compare(value wrapper1, value wrapper2)
+{
+ st_event ts1 = Threadstatus_val(wrapper1);
+ st_event ts2 = Threadstatus_val(wrapper2);
+ return ts1 == ts2 ? 0 : ts1 < ts2 ? -1 : 1;
+}
+
static struct custom_operations caml_threadstatus_ops = {
"_threadstatus",
caml_threadstatus_finalize,
- custom_compare_default,
+ caml_threadstatus_compare,
custom_hash_default,
custom_serialize_default,
custom_deserialize_default,