From 8a300b88f07946943fa106da7d2b4e7c207f2e96 Mon Sep 17 00:00:00 2001 From: rincon Date: Thu, 14 Jun 2007 04:39:02 +0000 Subject: [PATCH] Made it a little more async friendly --- tos/system/ActiveMessageAddressC.nc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tos/system/ActiveMessageAddressC.nc b/tos/system/ActiveMessageAddressC.nc index 098c26d0..40f0c0fe 100644 --- a/tos/system/ActiveMessageAddressC.nc +++ b/tos/system/ActiveMessageAddressC.nc @@ -75,7 +75,9 @@ implementation { * @return the group address of this node */ async command am_group_t ActiveMessageAddress.amGroup() { - return group; + am_group_t myGroup; + atomic myGroup = group; + return myGroup; } /** @@ -83,7 +85,7 @@ implementation { * @param group The group address */ async command void ActiveMessageAddress.setAmGroup(am_group_t myGroup) { - group = myGroup; + atomic group = myGroup; signal ActiveMessageAddress.changed(); } @@ -94,7 +96,9 @@ implementation { * @deprecated Use ActiveMessageAddress.amAddress() instead */ async command am_addr_t amAddress() { - return addr; + am_addr_t myAddr; + atomic myAddr = addr; + return myAddr; } /** @@ -104,7 +108,7 @@ implementation { * @deprecated Use ActiveMessageAddress.setAmAddress() instead */ async command void setAmAddress(am_addr_t a) { - addr = a; + atomic addr = a; signal ActiveMessageAddress.changed(); } -- 2.39.2