Skip to content

Instantly share code, notes, and snippets.

diff --git a/gevent/greenlet.py b/gevent/greenlet.py
index 93076db..351aac6 100644
--- a/gevent/greenlet.py
+++ b/gevent/greenlet.py
@@ -156,6 +156,20 @@ class Greenlet(greenlet):
self._notifier = None
self._start_event = None
+ current = getcurrent()
+ self._leader = getattr(current, "_leader", None)
@schmir
schmir / s.py
Created September 7, 2010 21:22
#!/usr/bin/env python
# only works with patched gevent from http://github.com/schmir/gevent
from gevent import tlmonkey
tlmonkey.patch_all()
import gevent
from gevent import tpool
import sys
#! /usr/bin/env python
import sys, os, signal, getopt, time
base_cgroup = "/cgroup"
def get_pids(name):
pids = open(os.path.join(base_cgroup, name, "tasks")).read().split()
return pids
# Last-changed: 2010-07-29 00:39:14 by ralf
"""
this module installs a custom __import__ function, which switches
sys.modules on a per-thread basis. patch_all must be called from the
gevent thread. the threads will only import unpatched modules.
"""
import imp, sys, threading
;;; cwc.el --- whitespace-cleanup only for changed lines
;;
;; Author: Ralf Schmitt <[email protected]>
;; Version: 0.1
;; Last Changed: 2010-04-13 17:03:32 by ralf
;;; Commentary:
;;
;; run whitespace-cleanup only on changed lines in a buffer. needs
;; highlight-changes mode to do it's work.