Branch: Tag:


2015-07-30 16:25:48 by Henrik Grubbström (Grubba) <>

Pike.identify_cycle: Fixed global variable overwrite.

Pike.identify_cycle() uses a mapping internally, and insert into
mappings can call Pike code (via LFUN:__hash()), which could
have a different thread also start messing with the same variables.

This fixes the multi-thread case, but there's still a problem if it
starts to recurse (ie LFUN::__hash() calling Pike.identify_cycle()
or Pike_count_memory()).

68:    TRACE((stderr, "Init cpp...\n"));    init_cpp();    +  TRACE((stderr, "Init memory counter...\n")); +  init_mc(); +     TRACE((stderr, "Init backend...\n"));    init_backend();   
125: Inside #if defined(DO_PIKE_CLEANUP)
   cleanup_compiler();    cleanup_error();    exit_backend(); +  exit_mc();    cleanup_gc();    cleanup_pike_types();