You check the stacktrace of the background process and see which function got called. How you do that depends on the implementation. If you have some handle to the called function, you can check that against the current definition. Functions are 'objects' and you can compare them for identity. In real implementations there also will be some id.
Comments
You check the stacktrace of the background process and see which function got called. How you do that depends on the implementation. If you have some handle to the called function, you can check that against the current definition. Functions are 'objects' and you can compare them for identity. In real implementations there also will be some id.
Did the function object have a reference to the source object, so that it would be possible to read the original source until it is garbage collected?