X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fsvm%2Fsvm_fifo.h;h=4a119341d8b3cb3a519e360c4ab6c56331e86e26;hb=c5df8c71c;hp=d7146ae1fb0b1013a0ad4f5848f8291291e32ff1;hpb=0964985cdd99cf769582e0d9393de68a95b121b9;p=vpp.git diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h index d7146ae1fb0..4a119341d8b 100644 --- a/src/svm/svm_fifo.h +++ b/src/svm/svm_fifo.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Cisco and/or its affiliates. + * Copyright (c) 2016-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -173,18 +173,18 @@ svm_fifo_set_event (svm_fifo_t * f) { /* return __sync_lock_test_and_set (&f->has_event, 1) == 0; return __sync_bool_compare_and_swap (&f->has_event, 0, 1); */ - return !__atomic_exchange_n (&f->has_event, 1, __ATOMIC_RELEASE); + return !clib_atomic_swap_rel_n (&f->has_event, 1); } /** * Unsets fifo event flag. * - * Also acts as a release barrier. + * Also acts as an acquire barrier. */ always_inline void svm_fifo_unset_event (svm_fifo_t * f) { - clib_atomic_release (&f->has_event); + clib_atomic_swap_acq_n (&f->has_event, 0); } svm_fifo_t *svm_fifo_create (u32 data_size_in_bytes);