/[pdpsoft]/trunk/grid-mw-security/ees/src/aos/aos.c
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/src/aos/aos.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1747 by aramv, Wed Jun 9 12:33:41 2010 UTC revision 1748 by aramv, Wed Jun 9 13:46:31 2010 UTC
# Line 61  aos_storage_t* aos_get_storage(){ Line 61  aos_storage_t* aos_get_storage(){
61    return iterator->current_storage;    return iterator->current_storage;
62  }  }
63    
64    EES_RC aos_free_state(aos_state_t* state){
65      printf("Freeing state at %p\n", state);
66      if(state == _global_state){
67        printf("Trying to free global state!\n");
68      }
69      aos_free_storage(state->saved_storage);
70      state->saved_storage = NULL;
71      state->last_context  = NULL;
72    }
73    
74  /**  /**
75   * Frees storage struct pointed to by storage pointer   * Frees storage struct pointed to by storage pointer
76   */   */
# Line 436  void aos_make_key(void){ Line 446  void aos_make_key(void){
446  /**  /**
447   * Frees thread-local storage key   * Frees thread-local storage key
448   */   */
449  void aos_free_key(void* iterator){  void aos_free_key(void* state){
450    pid_t             tid;    pid_t             tid;
451    aos_storage_t*    storage;    aos_storage_t*    storage;
452    aos_state_t*   tmp_iterator = (aos_state_t*) iterator;    aos_state_t*      tmp_state = (aos_state_t*) state;
453    /*tid = gettid();*/    /*tid = gettid();*/
454    tid = syscall(SYS_gettid);    tid = syscall(SYS_gettid);
455    EEF_log(LOG_DEBUG, "Killing thread %i\n", tid);    EEF_log(LOG_DEBUG, "Killing thread %i\n", tid);
456    aos_free_storage(tmp_iterator->current_storage);    aos_free_state(tmp_state);
457  }  }
458    
459  /**  /**
# Line 457  EES_RC AOS_Clean(void){ Line 467  EES_RC AOS_Clean(void){
467    if(!_is_threading){    if(!_is_threading){
468      return EES_FAILURE;      return EES_FAILURE;
469    }    }
470    aos_free_storage(aos_get_storage());    aos_free_state(aos_get_state());
471    return EES_SUCCESS;    return EES_SUCCESS;
472  }  }
473    
# Line 467  EES_RC AOS_Clean(void){ Line 477  EES_RC AOS_Clean(void){
477  EES_RC AOS_Term (void){  EES_RC AOS_Term (void){
478    _is_threading = 0;    _is_threading = 0;
479    /*aos_free_storage(_global_storage);*/    /*aos_free_storage(_global_storage);*/
480      aos_free_state(_global_state);
481    pthread_setspecific(_aos_key, NULL);    pthread_setspecific(_aos_key, NULL);
482    pthread_key_delete(_aos_key);    pthread_key_delete(_aos_key);
483    _is_initialized = 0;    _is_initialized = 0;

Legend:
Removed from v.1747  
changed lines
  Added in v.1748

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28