devxlogo

June 29, 2006

A Safe Way to Stop a Java Thread

The Thread.stop() method is unsafe and thus deprecated. If the thread being stopped was modifying common data, that common data remains in an inconsistent state. A better way would be

Debug-friendly New and Delete

For better handling of resource leaks, try “marking” the allocation with ancillary information: #include #include #include #include typedef void FDEL(void* p, size_t size);typedef FDEL* PFDEL;class A{ int a; static void