This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
type RWMutex struct { | |
qr chan struct{} // queue of readers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
get_next() { | |
IFS=: | |
id=$(stat -c '%D:%i' "$1") | |
prg= | |
name=$(basename "$0") | |
for p in $PATH ; do | |
n="$p/$name" | |
if test -e "$n" ; then | |
nid=$(stat -c '%D:%i' "$n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needle=/usr/lib/chromium/chromium | |
cd /proc | |
for pid in * ; do | |
if test -e "$pid/cmdline" ; then | |
read cmd rest < $pid/cmdline | |
if test "$cmd" = "$needle" ; then | |
echo $pid | |
fi | |
esac | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object { | |
public: | |
Object() { } | |
virtual ~Object() { } | |
}; | |
class NeedsObject { | |
protected: | |
NeedsObject(Object *object) : object(object) { } |
NewerOlder