trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: Fix for JIRA [TRAFODION-1713]
Date Wed, 03 Feb 2016 16:48:30 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/304#discussion_r51749694
  
    --- Diff: core/sqf/src/tm/idtmsrv.cpp ---
    @@ -53,6 +56,37 @@ void do_reply(BMS_SRE *pp_sre, char *pp_reply, int pv_len, short pv_ec);
     
     
     //
    +// Reset the global time counter
    +//
    +void reset_time_counter() {
    +
    +    struct timespec lv_new_ts;
    +
    +    clock_gettime(CLOCK_REALTIME, &lv_new_ts);
    +    unsigned long lv_new_tsl = ((unsigned long) lv_new_ts.tv_sec << 20) |
    +                               ((unsigned long) lv_new_ts.tv_nsec / 1000);
    +
    +    unsigned long lv_existing_tsl = __sync_add_and_fetch_8(gp_shm, 0);
    +    __sync_add_and_fetch_8(gp_shm, lv_new_tsl - lv_existing_tsl);
    --- End diff --
    
    Can time go backwards here? And would that cause a problem?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message