Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #------------------
- # threads
- #------------------
- def p_thread_stmts(p):
- '''thread_stmts : thread_start NEWLINE INDENT thread_params DEDENT'''
- # append new thread to request container
- p.lexer.request.add_thread(p.lexer.thread)
- # return
- p[0] = ('thread', p.lexer.thread)
- def p_thread_start(p):
- '''thread_start : THREAD VARNAME'''
- # create a new thread, and set the current thread context
- p.lexer.thread = RequestThread(name=p[2])
- # throw away return
- p[0] = ('thread', p[2])
- def p_thread_params(p):
- '''thread_params : thread_params thread_param
- | thread_param'''
- if len(p) == 3:
- p[0] = (p[2], p[1])
- else:
- p[0] = p[1]
- def p_thread_param_task(p):
- '''thread_param : TASKS EQ exprlist'''
- p.lexer.thread.set_taskgroup_links(p[3])
- p[0] = ('tasks', p[3])
- def p_thread_param_pop(p):
- '''thread_param : POP EQ NUMBER'''
- p.lexer.thread.set_pop(p[3])
- p[0] = ('pop', p[3])
- def p_thread_param_rollback(p):
- '''thread_param : ROLLBACK EQ BOOL'''
- p.lexer.thread.set_rollback(p[3])
- p[0] = ('rollback_on_error', p[3])
Add Comment
Please, Sign In to add comment