Merge branch 'master' of ssh://scm.schwerkraft.elitedvb.net/scmrepos/git/enigma2...
[enigma2-plugins.git] / mytube / src / ThreadQueue.py
1 from threading import Lock
2
3 class ThreadQueue:
4         def __init__(self):
5                 self.__list = [ ]
6                 self.__lock = Lock()
7
8         def push(self, val):
9                 lock = self.__lock
10                 lock.acquire()
11                 self.__list.append(val)
12                 lock.release()
13
14         def pop(self):
15                 lock = self.__lock
16                 lock.acquire()
17                 ret = self.__list.pop()
18                 lock.release()
19                 return ret
20