Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-2254

ink_atomic_increment should return the old value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.1.2
    • Core
    • None

    Description

      lib/ts/ink_atomic.h
      197 template<>
      198 inline int64_t
      199 ink_atomic_increment<int64_t>(pvint64 mem, int64_t value)

      { 200 int64_t curr; 201 ink_mutex_acquire(&__global_death); 202 curr = *mem; 203 *mem = curr + value; 204 ink_mutex_release(&__global_death); 205 return curr + value; //SHOULD return curr! 206 }

      this function should return the old value (curr, NOT curr + value). it should return same value as gcc inline function __sync_fetch_and_add.

      Attachments

        Activity

          People

            happy_fish100 Yu Qing
            happy_fish100 Yu Qing
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: