Guard.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: euc-jp -*-
00003 
00004 ##
00005 # @file  Guard.py
00006 # @brief RT-Middleware mutx guard class
00007 # @date  $Date$
00008 # @author Noriaki Ando <n-ando@aist.go.jp> and Shinji Kurihara
00009 #
00010 # Copyright (C) 2008
00011 #     Noriaki Ando
00012 #     Task-intelligence Research Group,
00013 #     Intelligent Systems Research Institute,
00014 #     National Institute of
00015 #         Advanced Industrial Science and Technology (AIST), Japan
00016 #     All rights reserved.
00017 #
00018 
00019 
00020 ##
00021 # @if jp
00022 # @class ScopedLock
00023 # @brief ScopedLock クラス
00024 #
00025 # 排他処理用ロッククラス。
00026 #
00027 # @since 0.4.0
00028 #
00029 # @else
00030 #
00031 # @endif
00032 class ScopedLock:
00033   """
00034   """
00035 
00036   ##
00037   # @if jp
00038   # @brief コンストラクタ
00039   #
00040   # コンストラクタ
00041   #
00042   # @param self
00043   # @param mutex ロック用ミューテックス
00044   #
00045   # @else
00046   #
00047   # @endif
00048   def __init__(self, mutex):
00049     self.mutex = mutex
00050     self.mutex.acquire()
00051 
00052 
00053   ##
00054   # @if jp
00055   # @brief デストラクタ
00056   #
00057   # デストラクタ
00058   #
00059   # @param self
00060   #
00061   # @else
00062   #
00063   # @endif
00064   def __del__(self):
00065     self.mutex.release()
00066 


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Aug 27 2015 14:17:28