]> git.sur5r.net Git - openldap/commitdiff
Add op->o_tincr to distinguish ops with same op->o_time. (We should
authorHoward Chu <hyc@openldap.org>
Thu, 9 Jun 2005 22:56:35 +0000 (22:56 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 9 Jun 2005 22:56:35 +0000 (22:56 +0000)
be preparing to use timestamps with sub-second resolution, really.)

servers/slapd/operation.c
servers/slapd/slap.h

index 4946c772fd2986676a0aa633b99c883ff2995100..b6a4ae0e54c969a0584b87fcfd85db5d3a2f189a 100644 (file)
@@ -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;
 
index 4b761747eca6923a82b72d1fba9b794a6bd44816..c79ef4c1c7a72649cbe5b685839d3b1a04dab81a 100644 (file)
@@ -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 */