Slideshow with setInterval

I want to make a game when in the intro there’s a slideshow with images. Here my code: $(“#intro-vid”).bind(“ended”, function() { intro_music.play(); $(‘#intro-vid’).hide(); $(‘#intro-img-1’).fadeIn(“slow”); setTimeout(function() { $(‘#intro-img-1’).fadeOut(“slow”); $(‘#intro-img-2’).fadeIn(“slow”); setTimeout(function() { $(‘#intro-img-2’).fadeOut(“slow”); $(‘#intro-img-3’).fadeIn(“slow”); setTimeout(function() { $(‘#intro-img-3’).fadeOut(“slow”); $(‘#intro-img-4’).fadeIn(“slow”); setTimeout(function() { $(‘#intro-img-4’).fadeOut(“slow”); $(‘#intro-img-5′).fadeIn(“slow”); }, 1800); }, 1900); }, 1950); }, 2000); }); What I’m doing here is when…

Details

Atomic swap map pointer cause program stuck

package main import ( “fmt” “sync/atomic” “unsafe” ) func main(){ old := make(map[string]string) new := make(map[string]string) new[“hello”] = “apple” fmt.Println(“start swap”) atomic.SwapPointer((*unsafe.Pointer)(unsafe.Pointer(&old)), unsafe.Pointer(&new)) fmt.Println(“end swap”) // pending here, don’t stop fmt.Println(old) fmt.Println(“end print old”) } I want a lock-free way to update old map with new map because of the old map will be concurrent…

Details