You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Yu Qing (JIRA)" <ji...@apache.org> on 2013/09/25 08:02:02 UTC

[jira] [Updated] (TS-2254) ink_atomic_increment should return the old value

     [ https://issues.apache.org/jira/browse/TS-2254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yu Qing updated TS-2254:
------------------------

    Assignee: Yu Qing
    
> ink_atomic_increment should return the old value
> ------------------------------------------------
>
>                 Key: TS-2254
>                 URL: https://issues.apache.org/jira/browse/TS-2254
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>            Reporter: Yu Qing
>            Assignee: Yu Qing
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira