00001 /* File: fem_lock_node.h 00002 * Authors: Nilesh Choudhury 00003 * 00004 */ 00005 00006 00007 #ifndef __CHARM_FEM_LOCK_H 00008 #define __CHARM_FEM_LOCK_H 00009 00010 #include "charm-api.h" 00011 #include "ckvector3d.h" 00012 #include "fem.h" 00013 #include "fem_mesh.h" 00014 00015 class femMeshModify; 00016 00017 //there is one fem_lock associated with every node (locks on elements are not required) 00018 //should lock all nodes, involved in any operation 00019 class FEM_lockN { 00020 int owner, pending; 00021 femMeshModify *theMod; 00022 int idx; //index of the node 00023 int noreadLocks; 00024 int nowriteLocks; 00025 00026 public: 00027 FEM_lockN() {}; 00028 FEM_lockN(int i,femMeshModify *mod); 00029 ~FEM_lockN(); 00030 00031 void reset(int i,femMeshModify *mod); 00032 int rlock(); 00033 int runlock(); 00034 int wlock(int own); 00035 int wunlock(int own); 00036 bool haslocks(); 00037 bool verifyLock(void); 00038 int lockOwner(); 00039 int getIdx() { return idx; } 00040 }; 00041 00042 #endif