Skip to content

Commit 9b7a2a9

Browse files
committed
opal/mutex: remove unnecessary ()s from OPAL_SCOPED_LOCK macro
This change allows the OPAL_SCOPED_LOCK macro to be used in more ways. For example, the following code didn't work before but would work now: ``` OPAL_SCOPED_LOCK(&lock, OPAL_LIST_FOREACH(item, list, item_type_t) { } ); ``` master commit open-mpi/ompi@f59b3ed Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 8f8590e commit 9b7a2a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

opal/threads/mutex.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -10,7 +11,7 @@
1011
* Copyright (c) 2004-2005 The Regents of the University of California.
1112
* All rights reserved.
1213
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
13-
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
14+
* Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
1415
* reserved.
1516
* Copyright (c) 2007 Voltaire. All rights reserved.
1617
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
@@ -253,10 +254,10 @@ static inline bool opal_set_using_threads(bool have)
253254
do { \
254255
if(opal_using_threads()) { \
255256
opal_mutex_lock(mutex); \
256-
(action); \
257+
action; \
257258
opal_mutex_unlock(mutex); \
258259
} else { \
259-
(action); \
260+
action; \
260261
} \
261262
} while (0)
262263

0 commit comments

Comments
 (0)