From e42e8d713000bc61cc0ef1b6871b1c1f61da8f2e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 9 Jun 2005 22:56:35 +0000 Subject: [PATCH] Add op->o_tincr to distinguish ops with same op->o_time. (We should be preparing to use timestamps with sub-second resolution, really.) --- servers/slapd/operation.c | 8 ++++++++ servers/slapd/slap.h | 1 + 2 files changed, 9 insertions(+) diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index 4946c772fd..b6a4ae0e54 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -39,6 +39,8 @@ static ldap_pvt_thread_mutex_t slap_op_mutex; static LDAP_STAILQ_HEAD(s_o, slap_op) slap_free_ops; +static time_t last_time; +static int last_incr; void slap_op_init(void) { @@ -142,6 +144,12 @@ slap_op_alloc( op->o_tag = tag; op->o_time = slap_get_time(); + if ( op->o_time == last_time ) { + op->o_tincr = ++last_incr; + } else { + last_time = op->o_time; + last_incr = 0; /* o_tincr is alredy zero */ + } op->o_opid = id; op->o_res_ber = NULL; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 4b761747ec..c79ef4c1c7 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -2291,6 +2291,7 @@ typedef struct slap_op { ber_tag_t o_tag; /* tag of the request */ time_t o_time; /* time op was initiated */ + int o_tincr; /* counter for multiple ops with same o_time */ BackendDB *o_bd; /* backend DB processing this op */ struct berval o_req_dn; /* DN of target of request */ -- 2.39.2