comment out semaphore shit in teakra

This commit is contained in:
Arisotura 2022-10-25 00:09:43 +02:00
parent 9e449d902d
commit 936011964c
1 changed files with 12 additions and 12 deletions

View File

@ -14,7 +14,7 @@ public:
void Send(u16 data) {
{
std::lock_guard lock(mutex);
//std::lock_guard lock(mutex);
ready = true;
this->data = data;
if (disable_interrupt)
@ -24,20 +24,20 @@ public:
handler();
}
u16 Recv() {
std::lock_guard lock(mutex);
//std::lock_guard lock(mutex);
ready = false;
return data;
}
u16 Peek() const {
std::lock_guard lock(mutex);
//std::lock_guard lock(mutex);
return data;
}
bool IsReady() const {
std::lock_guard lock(mutex);
//std::lock_guard lock(mutex);
return ready;
}
u16 GetDisableInterrupt() const {
std::lock_guard lock(mutex);
//std::lock_guard lock(mutex);
return disable_interrupt;
}
void SetDisableInterrupt(u16 v) {
@ -107,7 +107,7 @@ void Apbp::SetDataHandler(unsigned channel, std::function<void()> handler) {
}
void Apbp::SetSemaphore(u16 bits) {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
impl->semaphore |= bits;
bool new_signal = (impl->semaphore & ~impl->semaphore_mask) != 0;
if (new_signal && impl->semaphore_handler) {
@ -117,33 +117,33 @@ void Apbp::SetSemaphore(u16 bits) {
}
void Apbp::ClearSemaphore(u16 bits) {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
impl->semaphore &= ~bits;
impl->semaphore_master_signal = (impl->semaphore & ~impl->semaphore_mask) != 0;
}
u16 Apbp::GetSemaphore() const {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
return impl->semaphore;
}
void Apbp::MaskSemaphore(u16 bits) {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
impl->semaphore_mask = bits;
}
u16 Apbp::GetSemaphoreMask() const {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
return impl->semaphore_mask;
}
void Apbp::SetSemaphoreHandler(std::function<void()> handler) {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
impl->semaphore_handler = std::move(handler);
}
bool Apbp::IsSemaphoreSignaled() const {
std::lock_guard lock(impl->semaphore_mutex);
//std::lock_guard lock(impl->semaphore_mutex);
return impl->semaphore_master_signal;
}
} // namespace Teakra