GTNewHorizons / ThaumicHorizons

Authorized Continuation
GNU Lesser General Public License v3.0
7 stars 19 forks source link

Remove unsafe threading #42

Closed shpaass closed 1 year ago

shpaass commented 1 year ago

The threading was not working because Thread.run() does not start a new thread. Thread.start() should've been used for that. What is more, the threading was not safe because getting World is not a thread-safe operation, so threading was removed altogether from this part.

First two ifs can be summarized as "if dimension is not created then create it, and if it's already created then handle it".

Because createDimension is now single-threaded, we can call it without checking if it's already in the process of creating a dimension. The handling of creating a dimension was put in createDimension.

shpaass commented 1 year ago

I could not reproduce the crash today, so the commits that fixed it with a crutch were removed.

shpaass commented 1 year ago

The PR is ready for the review.

Alastors commented 1 year ago

@eigenraven