- Timestamp:
- Aug 14, 2006 12:55:27 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp
r666 r680 66 66 * This is the main entry for all threads. 67 67 */ 68 TInt *thread_main(TAny *param)68 TInt thread_main(TAny *param) 69 69 { 70 70 pj_thread_t *rec = (pj_thread_t *) param; 71 TInt *result;71 TInt result; 72 72 /* pj_status_t rc; */ 73 73 … … 75 75 76 76 /* Call user's entry! */ 77 result = (TInt *)(long)(*rec->proc)(rec->arg);77 result = (TInt)(*rec->proc)(rec->arg); 78 78 79 79 /* Done. */ … … 119 119 rec->proc = proc; 120 120 rec->arg = arg; 121 _LIT( KThreadName, "A name");122 rc = rec->thread.Create(KThreadName, thread_main, 4096, KMinHeapSize, 256*16, rec->arg, EOwner Process);121 _LIT( KThreadName, "Athread"); 122 rc = rec->thread.Create(KThreadName, thread_main, 4096, KMinHeapSize, 256*16, rec->arg, EOwnerThread); 123 123 if (rc != 0) { 124 124 return PJ_RETURN_OS_ERROR(rc); … … 131 131 } 132 132 133 /* 134 * pj_thread-get_name() 135 */ 136 PJ_DEF(const char*) pj_thread_get_name(pj_thread_t *p) 137 { 138 pj_thread_t *rec = (pj_thread_t*)p; 139 140 return rec->obj_name; 141 } 142 143 /* 144 * pj_thread_resume() 145 */ 146 PJ_DEF(pj_status_t) pj_thread_resume(pj_thread_t *p) 147 { 148 pj_status_t rc; 149 150 pj_thread_t *rec = (pj_thread_t*)p; 151 152 rec->thread.Resume(); 153 154 rc = PJ_SUCCESS; 155 156 return rc; 157 } 158 159 /* 160 * pj_thread_this() 161 */ 162 PJ_DEF(pj_thread_t*) pj_thread_this(void) 163 { 164 // TODO 165 return NULL; 166 } 167 168 /* 169 * pj_thread_join() 170 */ 171 PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *p) 172 { 173 pj_thread_t *rec = (pj_thread_t *)p; 174 TRequestStatus result; 175 176 //PJ_LOG(6, (pj_thread_this()->obj_name, "Joining thread %s", p->obj_name)); 177 178 rec->thread.Rendezvous(result); 179 180 return PJ_SUCCESS; 181 } 182 183 /* 184 * pj_thread_destroy() 185 */ 186 PJ_DEF(pj_status_t) pj_thread_destroy(pj_thread_t *p) 187 { 188 pj_thread_t *rec = (pj_thread_t *)p; 189 rec->thread.Kill(1); 190 191 192 return PJ_SUCCESS; 193 } 194 195 /* 196 * pj_thread_sleep() 197 */ 198 PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec) 199 { 200 if (sleep(msec * 1000) == 0) 201 return PJ_SUCCESS; 202 } 203 204 133 205 /////////////////////////////////////////////////////////////////////////////// 134 206 /* 135 207 * pj_thread_local_alloc() 136 208 */ 209 137 210 PJ_DEF(pj_status_t) pj_thread_local_alloc(long *index) 138 211 { … … 175 248 pj_mutex_t **mutex ) 176 249 { 250 (*mutex) = (pj_mutex_t *)1; 177 251 return PJ_SUCCESS; 178 252 } … … 187 261 188 262 /* 263 * pj_mutex_trylock() 264 */ 265 PJ_DEF(pj_status_t) pj_mutex_trylock(pj_mutex_t *mutex) 266 { 267 return PJ_SUCCESS; 268 } 269 270 /* 189 271 * pj_mutex_unlock() 190 272 */
Note: See TracChangeset
for help on using the changeset viewer.