You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by weijin <we...@126.com> on 2013/03/22 01:24:18 UTC

Re: [1/3] git commit: Fix bug with 128 bit compare and swap.

well done, John.

should we also changed ink_queue_load_64 to
void
ink_queue_load_64(void *dst, void *src)
{
#if (defined(__i386__) || defined(__arm__)) && (SIZEOF_VOIDP == 4)
   __sync_fetch_and_add((int64_t*)&(src), 0)
#else
   *(void**)dst = *(void**)src;
#endif
}

If not, could you please explain the reasons ? thanks.

On 03/22/2013 04:54 AM, jplevyak@apache.org wrote:
> Updated Branches:
>    refs/heads/master 1a2ebccb1 -> f41323e01
>
>
> Fix bug with 128 bit compare and swap.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4a090831
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4a090831
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4a090831
>
> Branch: refs/heads/master
> Commit: 4a0908314acb301f1e9eb691bbcd8d956e86c321
> Parents: 57ffdf5
> Author: jplevyak@apache.org <jp...@apache.org>
> Authored: Thu Mar 21 10:10:16 2013 -0700
> Committer: John Plevyak <jp...@acm.org>
> Committed: Thu Mar 21 10:10:16 2013 -0700
>
> ----------------------------------------------------------------------
>   lib/ts/ink_queue.h |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4a090831/lib/ts/ink_queue.h
> ----------------------------------------------------------------------
> diff --git a/lib/ts/ink_queue.h b/lib/ts/ink_queue.h
> index 6ac9945..20fbf9a 100644
> --- a/lib/ts/ink_queue.h
> +++ b/lib/ts/ink_queue.h
> @@ -72,7 +72,7 @@ extern "C"
>   #endif
>   
>   #if TS_HAS_128BIT_CAS
> -#define INK_QUEUE_LD(dst,src) *((__int128_t*)&(dst)) = *((__int128_t*)&(src))
> +#define INK_QUEUE_LD(dst,src) *(__int128_t*)&(dst) = __sync_fetch_and_add((__int128_t*)&(src), 0)
>   #else
>   #define INK_QUEUE_LD(dst,src) INK_QUEUE_LD64(dst,src)
>   #endif
>
>