()
| 111 | } |
| 112 | |
| 113 | func (mainThread *phpMainThread) start() error { |
| 114 | if C.frankenphp_new_main_thread(C.int(mainThread.numThreads)) != 0 { |
| 115 | return ErrMainThreadCreation |
| 116 | } |
| 117 | |
| 118 | mainThread.state.WaitFor(state.Ready) |
| 119 | |
| 120 | // cache common request headers as zend_strings (HTTP_ACCEPT, HTTP_USER_AGENT, etc.) |
| 121 | if commonHeaders == nil { |
| 122 | commonHeaders = make(map[string]*C.zend_string, len(phpheaders.CommonRequestHeaders)) |
| 123 | for key, phpKey := range phpheaders.CommonRequestHeaders { |
| 124 | commonHeaders[key] = newPersistentZendString(phpKey) |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | return nil |
| 129 | } |
| 130 | |
| 131 | func getInactivePHPThread() *phpThread { |
| 132 | for _, thread := range phpThreads { |
no test coverage detected