Skip to content

Instantly share code, notes, and snippets.

View sadegh's full-sized avatar
🎯
Focusing

Sadegh sadegh

🎯
Focusing
View GitHub Profile
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
public class PausableExecutor extends ThreadPoolExecutor {
private boolean isPaused;
private ReentrantLock pauseLock = new ReentrantLock();
private Condition unPaused = pauseLock.newCondition();
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport --disassociate
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/./0/2; s/.$//')
networksetup -detectnewhardware
package com.skazemy;
import java.util.ArrayList;
import java.util.List;
/**
* This example shows that after calling wait() on an object, it will release that object's monitor lock,
* so that other threads can enter the synchronized block. It also shows once notifyAll()
* is called, first that thread has to exit the synchronized block, then each waiting thread starts
* doing their work one by one, each has to exit their synchronized block so the other can wake up