I know the working of static variables in Multi-threaded environment, but I never used static variables ( please check the code sent in one of my previous reply ) to save the unique-id. I'm using volatile keyword which is completely different from static variable ( one of the storage classes in c ), and the usage of volatile keyword here is to tell the compiler to not perform optimisation ( while compilation ) on this variable. This is useful in multi-threaded environment, as in global variable should be declared volatile[1] in this type of environment for shared global variables.
Regarding the second comment about unique-id being whatever at some point of time : let me clear this thing, I already stated in my last reply that I'm getting unique-id ( belonging to a call ) in logs correctly even in concurrent calls ( tested with more than 1 call ). Please correct me if I'm wrong here. @Richard Mudgett : Please validate the changes I did. [1] <https://docs.google.com/presentation/d/11LC-_e1EGL3X-n7gU_Z2uSNvPX41t6LVngO9AxBi4wo/edit?usp=sharing> Thank you all.
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev