Lines Matching defs:tok
282 PyContextToken *tok = token_new(ctx, var, old_val);
286 Py_DECREF(tok);
290 return (PyObject *)tok;
300 PyContextToken *tok = (PyContextToken *)otok;
302 if (tok->tok_used) {
304 "%R has already been used once", tok);
308 if (var != tok->tok_var) {
310 "%R was created by a different ContextVar", tok);
315 if (ctx != tok->tok_ctx) {
317 "%R was created in a different Context", tok);
321 tok->tok_used = 1;
323 if (tok->tok_oldval == NULL) {
327 return contextvar_set(var, tok->tok_oldval);
1226 PyContextToken *tok = PyObject_GC_New(PyContextToken, &PyContextToken_Type);
1227 if (tok == NULL) {
1232 tok->tok_ctx = ctx;
1235 tok->tok_var = var;
1238 tok->tok_oldval = val;
1240 tok->tok_used = 0;
1242 PyObject_GC_Track(tok);
1243 return tok;