usermode/library/mtm/src/txlock.c

00001 /*
00002     Copyright (C) 2011 Computer Sciences Department, 
00003     University of Wisconsin -- Madison
00004 
00005     ----------------------------------------------------------------------
00006 
00007     This file is part of Mnemosyne: Lightweight Persistent Memory, 
00008     originally developed at the University of Wisconsin -- Madison.
00009 
00010     Mnemosyne was originally developed primarily by Haris Volos
00011     with contributions from Andres Jaan Tack.
00012 
00013     ----------------------------------------------------------------------
00014 
00015     Mnemosyne is free software; you can redistribute it and/or
00016     modify it under the terms of the GNU General Public License
00017     as published by the Free Software Foundation, version 2
00018     of the License.
00019  
00020     Mnemosyne is distributed in the hope that it will be useful,
00021     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023     GNU General Public License for more details.
00024 
00025     You should have received a copy of the GNU General Public License
00026     along with this program; if not, write to the Free Software
00027     Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00028     Boston, MA  02110-1301, USA.
00029 
00030 ### END HEADER ###
00031 */
00032 
00033 #include <pthread.h>
00034 #include "mtm_i.h"
00035 
00036 typedef pthread_mutex_t m_txmutex_t;
00037 
00038 void _ITM_CALL_CONVENTION m_txmutex_unlock_commit_action(void *arg)
00039 {
00040         m_txmutex_t *txmutex = (m_txmutex_t *) arg;
00041         pthread_mutex_t *mutex = (pthread_mutex_t *) txmutex;
00042 
00043         //printf("[%d] COMMIT: MUTEX  UNLOCK %p\n", pthread_self(), mutex);
00044         pthread_mutex_unlock(mutex);
00045 
00046         return;
00047 }
00048 
00049 typedef pthread_rwlock_t m_txrwlock_t;
00050 
00051 void _ITM_CALL_CONVENTION m_txrwlock_unlock_commit_action(void *arg)
00052 {
00053         m_txrwlock_t *txrwlock = (m_txrwlock_t *) arg;
00054         pthread_rwlock_t *rwlock = (pthread_rwlock_t *) txrwlock;
00055 
00056         //printf("[%d] COMMIT: RWLOCK UNLOCK %p\n", pthread_self(), rwlock);
00057         pthread_rwlock_unlock(rwlock);
00058 
00059         return;
00060 }

Generated on Sat Apr 23 11:43:36 2011 for Mnemosyne by  doxygen 1.4.7