// $Id$
-/* tab:4
+/*
* "Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
*
/**
* Set the active message address of this node
- * @param a The target active message address
+ * @param group The node's group ID
+ * @param addr The node's active message address
*/
- async command void ActiveMessageAddress.setAmAddress(am_addr_t a) {
- call setAmAddress(a);
+ async command void ActiveMessageAddress.setAddress(am_group_t myGroup, am_addr_t myAddr) {
+ atomic {
+ addr = myAddr;
+ group = myGroup;
+ }
+ signal ActiveMessageAddress.changed();
}
* @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;
}
- /**
- * Set the group address of this node
- * @param group The group address
- */
- async command void ActiveMessageAddress.setAmGroup(am_group_t myGroup) {
- group = myGroup;
- signal ActiveMessageAddress.changed();
- }
/***************** Deprecated Commands ****************/
/**
* @deprecated Use ActiveMessageAddress.amAddress() instead
*/
async command am_addr_t amAddress() {
- return addr;
+ am_addr_t myAddr;
+ atomic myAddr = addr;
+ return myAddr;
}
/**
* Set the node's default AM address.
*
* @param a - the address.
- * @deprecated Use ActiveMessageAddress.setAmAddress() instead
+ * @deprecated Use ActiveMessageAddress.setAddress() instead
*/
async command void setAmAddress(am_addr_t a) {
- addr = a;
+ atomic addr = a;
signal ActiveMessageAddress.changed();
}