Mercurial > pymonkey
comparison docs/rendered/_sources/pymonkey.txt @ 130:4705522c7431
Added notes about weak-referencability to docs.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 23 Aug 2009 17:57:04 -0700 |
parents | d30576edf797 |
children | 0c81cb18c935 |
comparison
equal
deleted
inserted
replaced
129:7b7a23615873 | 130:4705522c7431 |
---|---|
62 to verify that an object is a context, like so: | 62 to verify that an object is a context, like so: |
63 | 63 |
64 >>> cx = pymonkey.Runtime().new_context() | 64 >>> cx = pymonkey.Runtime().new_context() |
65 >>> isinstance(cx, pymonkey.Context) | 65 >>> isinstance(cx, pymonkey.Context) |
66 True | 66 True |
67 | |
68 JS contexts are weak-referencable. | |
67 | 69 |
68 .. method:: get_runtime() | 70 .. method:: get_runtime() |
69 | 71 |
70 Returns the :class:`Runtime` that the context belongs to. | 72 Returns the :class:`Runtime` that the context belongs to. |
71 | 73 |
254 With few exceptions, objects belonging to a runtime can currently | 256 With few exceptions, objects belonging to a runtime can currently |
255 only be used in the same thread that the runtime was created | 257 only be used in the same thread that the runtime was created |
256 in. This may be changed in the future, since SpiderMonkey itself | 258 in. This may be changed in the future, since SpiderMonkey itself |
257 has support for thread safety. | 259 has support for thread safety. |
258 | 260 |
261 JS runtimes are weak-referencable. | |
262 | |
259 .. method:: new_context() | 263 .. method:: new_context() |
260 | 264 |
261 Creates a new Context object and returns it. Contexts are best | 265 Creates a new Context object and returns it. Contexts are best |
262 conceptualized as threads of execution in a JS runtme; each one | 266 conceptualized as threads of execution in a JS runtme; each one |
263 has a program counter, a current exception state, and so | 267 has a program counter, a current exception state, and so |