__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# vim: set fileencoding=utf-8:
#
# GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
#
# Copyright (c) 2016-2023 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2020 Fangchen Li <fangchen.li@outlook.com>
# Copyright (c) 2016 Andrew Scheller <github@loowis.durge.org>
#
# SPDX-License-Identifier: BSD-3-Clause
from threading import Thread, Event
from .exc import ZombieThread
_THREADS = set()
def _threads_shutdown():
while _THREADS:
threads = _THREADS.copy()
# Optimization: instead of calling stop() which implicitly calls
# join(), set all the stopping events simultaneously, *then* join
# threads with a reasonable timeout
for t in threads:
t.stopping.set()
for t in threads:
t.join(10)
class GPIOThread(Thread):
def __init__(self, target, args=(), kwargs=None, name=None):
if kwargs is None:
kwargs = {}
self.stopping = Event()
super().__init__(None, target, name, args, kwargs)
self.daemon = True
def start(self):
self.stopping.clear()
_THREADS.add(self)
super().start()
def stop(self, timeout=10):
self.stopping.set()
self.join(timeout)
def join(self, timeout=None):
super().join(timeout)
if self.is_alive():
assert timeout is not None
# timeout can't be None here because if it was, then join()
# wouldn't return until the thread was dead
raise ZombieThread(f"Thread failed to die within {timeout} seconds")
else:
_THREADS.discard(self)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| fonts | Folder | 0755 |
|
|
| pins | Folder | 0755 |
|
|
| __init__.py | File | 2.61 KB | 0644 |
|
| boards.py | File | 100.87 KB | 0644 |
|
| compat.py | File | 1.23 KB | 0644 |
|
| devices.py | File | 24.3 KB | 0644 |
|
| exc.py | File | 7.39 KB | 0644 |
|
| input_devices.py | File | 53.61 KB | 0644 |
|
| internal_devices.py | File | 26.13 KB | 0644 |
|
| mixins.py | File | 20.46 KB | 0644 |
|
| output_devices.py | File | 60.73 KB | 0644 |
|
| spi_devices.py | File | 19.6 KB | 0644 |
|
| threads.py | File | 1.59 KB | 0644 |
|
| tones.py | File | 8.38 KB | 0644 |
|
| tools.py | File | 20.87 KB | 0644 |
|